开发者

UIDatePicker Not storing time in core data

开发者 https://www.devze.com 2022-12-25 18:17 出处:网络
I am using a UIDatepicker with only \"Time\", I save the time in a NSDate object type, however when I try to store the Object in core data I get an error saying its 开发者_StackOverflownot a NSDate ty

I am using a UIDatepicker with only "Time", I save the time in a NSDate object type, however when I try to store the Object in core data I get an error saying its 开发者_StackOverflownot a NSDate type...

 tt = [pickerTime date]; 

[myObject setValue:tt forKey:@"time"];

Thanks,


Hey, a see a mistake here:

tt = [pickerTime date]; 

tt's type is either an NSDate, or... You have to declare what tt is:

NSDate *tt = [pickerTime date]; 

Make sure that your using a date field in IB.

0

精彩评论

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