ios - How to pass these parameters into an NSString nsuserdefault -


i have 14 nsuserdefualt save keys , instead of adding 14 of them created loop handle this. getting error says many arguments. having brain fart , forgot something. tips or suggestions appreciated.

edit: trying read saved data.

   (int n=0; n==14; n++ ) {     nsstring *emailbody=[nsstring stringwithformat:@"enhancers: %@",                           [[nsuserdefaults standarduserdefaults]                           stringforkey:@"enhancer%i",n]];       } 

you had argument in format string "n" should have been placed in different format stringforkey:. should clear things up:

for (int n=0; n==14; n++ ) {     nsstring *stringfromdefaults = [[nsuserdefaults standarduserdefaults] stringforkey:[nsstring stringwithformat:@"%d",n]];     nsstring *emailbody=[nsstring stringwithformat:@"enhancers: %@",stringfromdefaults]; } 

Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -