ブックマーク / technical-iphone.blogspot.com (1)

  • UILocalNotification

    UILocalNotificationは、アプリケーションが終了した状態でも指定時間になったらメッセージを表示する等の動作を行わせることができる機能です。 // ローカル通知を作成 UILocalNotification *ln = [[UILocalNotification alloc] init]; NSDate *dt; dt = [NSDate dateWithTimeIntervalSinceNow:60]; // 60秒後に表示 // 通知時刻を設定 [ln setFireDate:dt]; // タイムゾーンを設定 [ln setTimeZone:[NSTimeZone localTimeZone]]; // メッセージを設定 [ln setAlertBody:@"起きて"]; // サウンド設定 [ln setSoundName:UILocalNotificationDef

  • 1