Skip to content

Instantly share code, notes, and snippets.

View tarappo's full-sized avatar
🤗
餃子は美味しい

tarappo tarappo

🤗
餃子は美味しい
View GitHub Profile
@tarappo
tarappo / file0.m
Last active August 29, 2015 14:05
NSUserDefaultsを使う際の注意点 ref: http://qiita.com/tarappo/items/e86a0d8dc36ad013fa6c
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
[ud setFloat:value forKey:"ShowValue"];
BOOL successful = [ud synchronize];
@tarappo
tarappo / file0.m
Created March 8, 2014 12:51
NSUserDefaultsでハマったこと -immutable/mutable- ref: http://qiita.com/tarappo/items/afbf3067dbec69f648b0
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
NSMutableDictionary *userInfo = [ud valueForKey:@"USER_INFO"];
[userInfo setObject:@"SAMPLE" forKey:@"A"];
[ud setValue:userInfo forKey:@"USER_INFO"];
@tarappo
tarappo / gist:4951343
Created February 14, 2013 08:31
特定のURLの時はブラウザで表示。 ※事前にself.webView.delegate = self;をしておく。
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
NSString *checkURL = [request.URL absoluteString];
NSRange linkMatch = [checkURL rangeOfString:@"http://example.com"];
if (linkMatch.location != NSNotFound) {
[[UIApplication sharedApplication] openURL:request.URL];
return NO;
}
}