Function Menu を整理する
# pragma mark - HogeFugo -
任意のコードからAppDelegateを参照する
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
deallocではrelease後に確実にnilにしておくこと
- (void) dealloc
{
[_var release], _var = nil;
}
I18n参照
[self setTitle:NSLocalizedString(@"key_for_your_string", "explain for this string")];
UIWebViewのUserAgentを指定
AppDelegateのinitializeでしか変えられない。
# AppDelegate.m
+ (void)initialize
{
NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"your_user_agent", @"UserAgent", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dictionary];
}