Reputation: 17
i guess my problem isn't a tough one.
I'm working on a local notification.
UILocalNotification* localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = pickerDate;
localNotification.alertBody = @"%@ additional text",[self nameTextField].text;
localNotification.alertAction = @"Show";
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.applicationIconBadgeNumber = [[UIApplication sharedApplication] applicationIconBadgeNumber] + 1;
localNotification.soundName = UILocalNotificationDefaultSoundName;
so far it works all as expected, but the Alertbody
just shows <null> "additional text"
why?
Upvotes: 0
Views: 33
Reputation: 7102
You can't do that, try
[NSString stringWithFormat:@"%@ additional text", [self nameTextField].text];
The way you're doing is to show string literals but will not work with variables.
I'm actually surprised the compiler let you get away with that.
Upvotes: 1