Iphone – A question regarding to the badge

iphone

I have

NSDictionary *dictionary =

{"aps":
{"alert":"This is a Push Message sent from Server!",
"badge":60
}
}

I have only 1 question

I need 60 from this NSDictionary into NString.

Best Answer

You can just get the NSNumber and format it as a string, something along the lines of:

NSDictionary *aps = [dictionary objectForKey:@"aps"];
NSNumber *num = [aps objectForKey:@"badge"];
NSString *numStr = [num stringValue];
Related Topic