- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我有一个像这样的 CFUserNotificationDisplayAlert 设置:
CFOptionFlags cfRes;
CFUserNotificationDisplayAlert(5, kCFUserNotificationNoteAlertLevel,
NULL, NULL, NULL,
CFSTR("Okay"),
CFSTR("Stop!"),
&cfRes);
switch (cfRes)
{
case kCFUserNotificationDefaultResponse:
strTest = CFSTR("Default response");
break;
case kCFUserNotificationAlternateResponse:
strTest = CFSTR("Alternate response");
break;
}
使用此代码我收到此错误:使用未声明的标识符 kCFUserNotifactationDefualtResponce (以及其他 kCF*)
有任何想法吗?我有以下进口:
#import <CoreFoundation/CoreFoundation.h>
#import <CoreData/CoreData.h>
#import <UIKit/UIKit.h>
最佳答案
The CFUserNotification API is not available on iOS. Looks to me like you copied that bit of code from a Mac App.
引自 CodaFi's comment以上问题可以标记为已回答:https://meta.stackexchange.com/questions/54718/how-should-i-handle-questions-which-are-answered-in-the-comments
关于ios - CFUserNotificationDisplayAlert CFOptionFlags 不工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16049642/
我有一个像这样的 CFUserNotificationDisplayAlert 设置: CFOptionFlags cfRes; CFUserNotificationDispl
我正在创建一个应用程序,即使 iPhone 屏幕锁定,也必须显示 CFUserNotificationDisplayAlert,目前我正在使用此代码 CFOptionFlags responseFla
如果我调用 CFUserNotificationDisplayAlert() 显示警告框,它会在控制台中打印以下消息: CFUserNotificationDisplayAlert: called
我是一名优秀的程序员,十分优秀!