Tag: 重复

如何避免在iOS中使用Facebook SDK的“重复状态消息”错误?

我想在iOS应用程序中将多个相同的消息发布到我的提要/墙上。 从第二次尝试,我收到这个错误 – (#506)重复的状态消息。 我该如何解决?

在本地通知中设置repeatInterval

我想设置重复时间间隔为用户从dateselect器中select的值。我在我的应用程序中有types倒计时模式的dateselect器。如果用户从dateselect器中select4小时15分钟,那么我使用下面的代码和闹铃。 [NSDate dateWithTimeIntervalSinceNow:[pickerTimer countDownDuration]] 但是我希望通知应在每4小时15分钟后重复,直到用户取消为止。 我已经做了很多search,但是我弄不清楚。到目前为止,我使用的代码是: localNotification = [[UILocalNotification alloc] init]; [localNotification setFireDate:[NSDate dateWithTimeIntervalSinceNow:[pickerTimer countDownDuration]]]; if(localNotification.fireDate){ [self _showAlert:@"Time is scheduled" withTitle:@"Daily Achiever"]; } localNotification.timeZone = [NSTimeZone systemTimeZone]; localNotification.alertBody=@"alaram"; localNotification.soundName = UILocalNotificationDefaultSoundName; [localNotification setAlertAction:@"View"]; [localNotification setRepeatInterval:[pickerTimer countDownDuration]]; //The button's text that launches the application and is shown in the alert // [localNotification setAlertBody:[alertBodyField text]]; //Set the […]

在Swift中每x分钟做一件事

我怎样才能每分钟运行一个function? 在JavaScript中我可以做类似setInterval事情,Swift中是否存在类似的东西? 通缉输出: Hello World每分钟一次…