ios - Get and update plist value -
i created plist titled "appdata.plist" in supporting files section of xcode. have key called "keyone" , trying value of it. i'm trying log value console nslog not working.
how do this? i've searched google , there lot of way none work me.
nsstring *myfile = [[nsbundle mainbundle] pathforresource: @"appdata" oftype: @"plist"]; nsdictionary *mydict = [nsdictionary dictionarywithcontentsoffile:myfile]; nsstring *viewcover = [[nsbundle mainbundle] objectforinfodictionarykey:@"keyone"];
this i've tried whole thing ends in errors, can't log , 'unusable variable' error.
the objectforinfodictionarykey
method retrieves value app's info.plist
file, isn't want -- want retreive dictionary mydict
. mentioned value boolean, replace last line with
bool viewcover = [[mydict objectforkey:@"keyone"] boolvalue];
Comments
Post a Comment