I have a plist file that contains some default values,
My goal is to copy these value in an object at runtime,
Half the values are fine, the other are set to nonsense ^^
plist:
<dict>
...
<key>averageCostDevelopPerApp</key>
<integer>50000</integer>
...
</dict>
printout of the dictionary in debugger:
averageCostDevelopPerApp = 50000;
printout of my object in the debugger:
averageCostDevelopPerApp = "-15536";
averageCostDevelopPerApp is declared like this:
@property (nonatomic, retain) NSNumber * averageCostDevelopPerApp;
and here is where I set the data in the object:
[self setAverageCostDevelopPerApp: [dictionary objectForKey:@"averageCostDevelopPerApp"]];
I did some digging and what objectforKey returns in a "__NSCFNumber".
I'm guessing I have to do some sor of conversion but I can't figure it out.
Sorry about that guys,
discovered in a flash of insperation so common after 12 hours coding @1am, that in the data model, the property was set the intger16...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.