![](/img/trans.png)
[英]How to register for an NSNotification from a UILocalNotification?
[英]how to load nsnotification text from an array
我想知道如何使用數組加載顯示在nsnotifcation中的文本? 我希望此通知中顯示的消息從數組加載,而不是將其作為固定的文本值。
不確定您要問的是什么,但是如果您將NSString作為數組中的對象,則可以使用以下方法訪問它:
NSString *yourMessageString = [yourArray objectAtIndex:0];
例如。
編輯:要將警報消息設置為數組中的消息,只需執行以下操作:
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Your Title"
message:[yourArray objectAtIndex:0]
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.