Reputation: 16051
I'm using NSUserDefaults and I have the code mondayalarm = [prefs stringForKey:@"mondayalarm"];
and mondayalarm (first reference, not the key) is an NSDate. It's giving me the warning:
incompatible Objective-C types assigning 'struct NSString *', expected 'struct NSDate *'
How can i make it accept this without the warning?
Upvotes: 3
Views: 1252
Reputation: 47034
To prevent the warning:
mondayalarm = (NSDate*)[prefs stringForKey:@"mondayalarm"];
To fix your problem:
mondayalarm = [prefs objectForKey:@"mondayalarm"];
Upvotes: 7