开发者

Setting Core Data property value with float type

In a test iPhone app I am developing, I am trying to set the value of a float field in my Core Data model. The compiler is giving me an incompatible type error even though both the data type specified in my method is a float and the data type in model is a float.

This is the first project where I am using Core Data instead of SQLite 3.

- (void)insertNewObject:(NSString *)titleTxt withAmount:(float)amount andDueDate:(NSDate *)due {
[newManagedObject setValue:amount forKey:开发者_StackOverflow中文版@"amountDue"];


You'll have to make an NSNumber with the float.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜