More Related Content
More from Hidetoshi Mori (15)
20130216 小ネタ集
- 1. 小ネタ集
h_mori
13年2月16日土曜日
- 2. 自己紹介
• 森 英寿(プログラマ)
hidetoshi.mori
@h_mori
SOICHA/TweetMe
ATND暦/生存連絡
13年2月16日土曜日
- 3. ExceptionHandler
void NSSetUncaughtExceptionHandler(NSUncaughtExceptionHandler *)
13年2月16日土曜日
- 5. void uncaughtExceptionHandler(NSException *exception) {
NSLog(@"CRASH: %@", exception);
NSLog(@"Stack Trace: %@", [exception callStackSymbols]);
}
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
return YES;
}
13年2月16日土曜日
- 7. NSAssert
• 想定の値を明示する
• 想定以外の場合に落ちる
• XCode4ではReleaseビルドは無視
13年2月16日土曜日
- 8. NSAssert
• バグで落ちない場所に使うと効果的
• ManagedObjectContextのnil
• 初期化済のチェック
• NSArray, NSDictionaryの初期化時の値
13年2月16日土曜日