ios - Integer read from plist always returns 0 -
i'm trying value of integer number plist.
nsstring *path = [[nsbundle mainbundle] pathforresource:@"prop" oftype:@"plist"]; nsdictionary *dict = [[nsdictionary alloc] initwithcontentsoffile:path]; int number = [[[dict objectforkey:@"root"] objectforkey:@"quant"] intvalue]; nslog(@"quant %d",number);
the plist:
<dict> <key>quant</key> <integer>5</integer> </dict>
app runs value of number 0.
have been reading various manuals whole day, can't find error.
Comments
Post a Comment