snipt

Ctrl+h for KB shortcuts

Objective-C

iOS SDK Url encode for special characters

1
2
3
4
5
//!*'();:@&=+$,/?%#[]
- (NSString *)encodeWith:(NSString *)string
{
    return CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (__bridge CFStringRef)string, NULL, CFSTR("!*'();:@&=+$,/?%#[]"), kCFStringEncodingUTF8));
}
https://snipt.net/embed/c45918d39b1af0c4d8b8878baf8a91ee/
https://snipt.net/raw/c45918d39b1af0c4d8b8878baf8a91ee/
c45918d39b1af0c4d8b8878baf8a91ee
objective-c
Objective-C
5
2016-09-26T17:29:42
True
False
True
Apr 02, 2014 at 07:42 PM
/api/public/snipt/126894/
ios-sdk-url-encode-for-special-characters
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c1">//!*&#39;();:@&amp;=+$,/?%#[]</span> </span><span id="L-2"><a name="L-2"></a><span class="p">-</span> <span class="p">(</span><span class="bp">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nf">encodeWith:</span><span class="p">(</span><span class="bp">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">string</span> </span><span id="L-3"><a name="L-3"></a><span class="p">{</span> </span><span id="L-4"><a name="L-4"></a> <span class="k">return</span> <span class="n">CFBridgingRelease</span><span class="p">(</span><span class="n">CFURLCreateStringByAddingPercentEscapes</span><span class="p">(</span><span class="n">kCFAllocatorDefault</span><span class="p">,</span> <span class="p">(</span><span class="k">__bridge</span> <span class="n">CFStringRef</span><span class="p">)</span><span class="n">string</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="n">CFSTR</span><span class="p">(</span><span class="s">&quot;!*&#39;();:@&amp;=+$,/?%#[]&quot;</span><span class="p">),</span> <span class="n">kCFStringEncodingUTF8</span><span class="p">));</span> </span><span id="L-5"><a name="L-5"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
SDK, Url, encode, iOS

Markdown

Remind101

With millions of users in over 10,000 schools, Remind101 is using accessible communication technology to connect teachers with students in real time and keep parents involved. Remind101 is the fastest growing, venture-backed startup in education and looking for a FT rails and iOS developer to join them in San Francisco. They are also open to contract work with a front-end dev with rails experience.

https://snipt.net/embed/e66ceb81603cf1a1c7e0329fa031db7e/
https://snipt.net/raw/e66ceb81603cf1a1c7e0329fa031db7e/
e66ceb81603cf1a1c7e0329fa031db7e
markdown
Markdown
1
2016-09-21T19:58:42
True
False
False
/api/public/snipt/59725/
remind101
<p>With millions of users in over 10,000 schools, Remind101 is using accessible communication technology to connect teachers with students in real time and keep parents involved. Remind101 is the fastest growing, venture-backed startup in education and looking for a FT rails and iOS developer to join them in San Francisco. They are also open to contract work with a front-end dev with rails experience.</p>
Rails, Remind101, Ruby, developers, hiring, iOS

Objective-C

Convert TimeStamp to NSDate in Objective-C

1
2
3
4
5
6
 	NSString * timeStampString =@"1304245000";
    NSTimeInterval _interval=[timeStampString doubleValue];
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:_interval];
    NSDateFormatter *_formatter=[[NSDateFormatter alloc]init];
    [_formatter setDateFormat:@"dd.MM.yyyy"];
    NSString *_date=[_formatter stringFromDate:date];
https://snipt.net/embed/80096aea8a580e7525414ba23201d30c/
https://snipt.net/raw/80096aea8a580e7525414ba23201d30c/
80096aea8a580e7525414ba23201d30c
objective-c
Objective-C
6
2016-09-23T22:13:19
True
False
False
Jan 15, 2013 at 11:24 AM
/api/public/snipt/53767/
convert-timestamp-to-nsdate-in-objective-c
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a> <span class="bp">NSString</span> <span class="o">*</span> <span class="n">timeStampString</span> <span class="o">=</span><span class="s">@&quot;1304245000&quot;</span><span class="p">;</span> </span><span id="L-2"><a name="L-2"></a> <span class="n">NSTimeInterval</span> <span class="n">_interval</span><span class="o">=</span><span class="p">[</span><span class="n">timeStampString</span> <span class="n">doubleValue</span><span class="p">];</span> </span><span id="L-3"><a name="L-3"></a> <span class="bp">NSDate</span> <span class="o">*</span><span class="n">date</span> <span class="o">=</span> <span class="p">[</span><span class="bp">NSDate</span> <span class="nl">dateWithTimeIntervalSince1970</span><span class="p">:</span><span class="n">_interval</span><span class="p">];</span> </span><span id="L-4"><a name="L-4"></a> <span class="bp">NSDateFormatter</span> <span class="o">*</span><span class="n">_formatter</span><span class="o">=</span><span class="p">[[</span><span class="bp">NSDateFormatter</span> <span class="n">alloc</span><span class="p">]</span><span class="n">init</span><span class="p">];</span> </span><span id="L-5"><a name="L-5"></a> <span class="p">[</span><span class="n">_formatter</span> <span class="nl">setDateFormat</span><span class="p">:</span><span class="s">@&quot;dd.MM.yyyy&quot;</span><span class="p">];</span> </span><span id="L-6"><a name="L-6"></a> <span class="bp">NSString</span> <span class="o">*</span><span class="n">_date</span><span class="o">=</span><span class="p">[</span><span class="n">_formatter</span> <span class="nl">stringFromDate</span><span class="p">:</span><span class="n">date</span><span class="p">];</span> </span></pre></div> </td></tr></table>
TimeStamp, iOS

CSS

Disable tap highlighting on your iOS web app

1
2
3
.fnord {
	-webkit-tap-highlight-color: rgba(0,0,0,0);
}
https://snipt.net/embed/a20f2da00ee6bd5e2e50bd81bb2e2303/
https://snipt.net/raw/a20f2da00ee6bd5e2e50bd81bb2e2303/
a20f2da00ee6bd5e2e50bd81bb2e2303
css
CSS
3
2016-09-26T21:51:34
True
False
False
/api/public/snipt/48683/
disable-tap-highlighting-on-your-ios-web-app
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nc">.fnord</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="o">-</span><span class="n">webkit</span><span class="o">-</span><span class="n">tap</span><span class="o">-</span><span class="n">highlight</span><span class="o">-</span><span class="k">color</span><span class="o">:</span> <span class="n">rgba</span><span class="p">(</span><span class="m">0</span><span class="o">,</span><span class="m">0</span><span class="o">,</span><span class="m">0</span><span class="o">,</span><span class="m">0</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
iOS, webkit
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.