开发者

how to load nsnotification text from an array

I am wondering how its possible to load the text displayed in an nsnotifcation using an array? I want the message shown in this notification to be loaded from an array and not for it to be a fixed text valu开发者_如何学Pythone.


Not sure what your question is asking, but if you have a NSString as an object in an array, you can access it by using:

NSString *yourMessageString = [yourArray objectAtIndex:0];

for example.

EDIT: To set the alert message to the message in the array, simply do this:

UIAlertView *alert = [[UIAlertView alloc] 
                     initWithTitle:@"Your Title" 
                     message:[yourArray objectAtIndex:0] 
                     delegate:self 
                     cancelButtonTitle:@"OK" 
                     otherButtonTitles:nil];
[alert show];
[alert release];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜