iphone - Show String together with text in Localnotification -


i guess problem isn't tough one.

i'm working on 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 works expected, alertbody shows <null> "additional text"

why?

you can't that, try

[nsstring stringwithformat:@"%@ additional text", [self nametextfield].text]; 

the way you're doing show string literals not work variables.

i'm surprised compiler let away that.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -