Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone IOS5中的本地通知-如何使其在屏幕上而不是在通知中心中弹出?_Iphone_Objective C_Ios5_Uilocalnotification - Fatal编程技术网

Iphone IOS5中的本地通知-如何使其在屏幕上而不是在通知中心中弹出?

Iphone IOS5中的本地通知-如何使其在屏幕上而不是在通知中心中弹出?,iphone,objective-c,ios5,uilocalnotification,Iphone,Objective C,Ios5,Uilocalnotification,我有一个使用本地通知的应用程序。 现在,当IOS5退出并显示通知警报时,它将转到通知中心,现在使用我的2个按钮(显示和取消)显示警报 谁能帮我弄清楚,这样我就可以在屏幕上弹出,而不是在通知中心(屏幕顶部的那一行) 这是我的代码: UILocalNotification *localNotif = [[UILocalNotification alloc] init]; localNotif.fireDate=[NSDate date];

我有一个使用本地通知的应用程序。 现在,当IOS5退出并显示通知警报时,它将转到通知中心,现在使用我的2个按钮(显示和取消)显示警报

谁能帮我弄清楚,这样我就可以在屏幕上弹出,而不是在通知中心(屏幕顶部的那一行)

这是我的代码:

 UILocalNotification *localNotif = [[UILocalNotification alloc] init];

                localNotif.fireDate=[NSDate date];
                localNotif.timeZone = [NSTimeZone defaultTimeZone];


                localNotif.alertBody = @"Application alerted";

                localNotif.alertAction = @"Show";

                localNotif.soundName = UILocalNotificationDefaultSoundName;
                localNotif.applicationIconBadgeNumber = 0;
                [[UIApplication sharedApplication]presentLocalNotificationNow:localNotif];
                [localNotif release];
谢谢,
Amir。

只有用户自己可以配置如何显示通知警报。用户还可以禁用应用程序的通知,或禁止它们进入通知中心。没有用于此的开发人员API。

您的意思是
UIAlertView
?您可以使用-(id)
initWithTitle
创建一个
AlertView
。。。您可以配置按钮,如果您的类是
UIAlertViewDelegate
,则您可以监听按钮单击等。它将弹出屏幕,允许用户取消该按钮或其他操作。

iOS 5仍在保密协议下,我不建议在此谈论它。警报操作字符串将显示在锁定屏幕中,当您滑过通知或在警报窗口中时(仅当用户将安装应用程序通知显示为警报时)