Hello. I'm diving into iOS development and I have a few questions about manipulating a simple Core Data object that I created in Xcode. After using the object editor, here's the class that Xcode generated for me...
@interface Alarm : NSManagedObject
{
}
@property (nonatomic, retain) NSNumber * Enabled;
@property (nonatomic, retain) NSString * Label;
@property (nonatomic, retain) NSNumber * Snooze;
@end
@implementation Alarm
@dynamic Enabled;
@dynamic Label;
@dynamic Snooze;
@end
Here's a code snipped where I try and create an Alarm
object that I plan to add to my ManagedObjectContext...
- (void)saveAlarm:(id)sender {
Alarm *alarm = [[Alarm alloc] init];
alarm.Label = [NSString stringWithString:txtLabel.text];
alarm.Snooze = [NSNumber numberWithBool:switchSnooze.on];
alarm.Enabled = [NSNumber numberWithBool:YES];
[addAlarmDelegate insertNewAlarm:alarm];
[alarm release];
}
My code crashes the first time I try and assign a value to one of the properties of alarm, on the line...
alarm.Label = [NSString stringWithString:txtLabel.text];
with the following crash message in the console...
reason: '-[Alarm setLabel:]: unrecognized selector sent to instance 0x5e33640
what am I missing here?
Thanks so much in advance for your help!