ios - CFUserNotificationDisplayAlert CFOptionFlags 不工作?
<p><p><br/>
我有这样的 CFUserNotificationDisplayAlert 设置:</p>
<pre><code>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;
}
</code></pre>
<p><br/>
使用此代码,我收到此错误:
<b>使用未声明的标识符 kCFUserNotifactationDefualtResponce </b>(以及其他 kCF*)<br/>
有任何想法吗?我导入了以下内容:
<br/></p>
<pre><code>#import <CoreFoundation/CoreFoundation.h>
#import <CoreData/CoreData.h>
#import <UIKit/UIKit.h>
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><blockquote>
<p>The CFUserNotification API is not available on iOS. Looks to me like you copied that bit of code from a Mac App.</p>
</blockquote>
<p><em>引自 <a href="https://stackoverflow.com/questions/16049642/cfusernotificationdisplayalert-cfoptionflags-not-working#comment22902155_16049642" rel="noreferrer noopener nofollow">CodaFi's comment</a>以上问题可以标记为已回答:<a href="https://meta.stackexchange.com/questions/54718/how-should-i-handle-questions-which-are-answered-in-the-comments" rel="noreferrer noopener nofollow">https://meta.stackexchange.com/questions/54718/how-should-i-handle-questions-which-are-answered-in-the-comments</a> </em></p></p>
<p style="font-size: 20px;">关于ios - CFUserNotificationDisplayAlert CFOptionFlags 不工作?,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/16049642/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/16049642/
</a>
</p>
页:
[1]