ios - 本地通知问题
<p><p>我正在尝试在数组日期与当前日期相同时收到通知,此代码用于此任务</p>
<pre><code>NSDateFormatter *Form = [ init];
;
UILocalNotification *notification = [ init];
for (int i=0;i<_convertedBdates.count;i++)
{
NSDate *date =];
NSLog(@"date%@",date);
if(notification)
{
notification.fireDate = date;
notification.timeZone = ;
notification.alertBody = @"New ";
notification.alertAction = @"View";
notification.soundName = UILocalNotificationDefaultSoundName;
notification.applicationIconBadgeNumber = 1;
[ scheduleLocalNotification:notification];
}
}
</code></pre>
<p>建议我做错了什么</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>您是否已将此代码放入您的应用委托(delegate)中?</p>
<pre><code> - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
NSLog(@"Notification Received, %@, set for date %@", notification.alertBody, notification.fireDate);
}
</code></pre>
<p>如果问题仍然存在,那么我就在这里 :)</p></p>
<p style="font-size: 20px;">关于ios - 本地通知问题,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/15516332/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/15516332/
</a>
</p>
页:
[1]