@Drew McCormack: I wish it did. I just tested this too, and get the same error at runtime, ie, that setTitle: doesn't exist.
I just made a Core Data project from scratch with this for the header: @interface Movie : NSManagedObject { }
@property (retain) NSString * title;
@end
And this for the implementation: @implementation Movie
@dynamic title;
@end
This in the controller: - (IBAction)testTitle:(id)sender
{
Movie* movie;
movie = [NSEntityDescription insertNewObjectForEntityForName:@"Movie"
inManagedObjectContext:self.managedObjectContext];
movie.title = @"My Movie";
[movie setTitle:@"My Movie 2"];
NSLog(@"%@", movie.title);
}
It prints "My Movie 2" and no exceptions are raised. Are you sure your model is correct?
by Scott Stevenson — Nov 04
I just made a Core Data project from scratch with this for the header:
@interface Movie : NSManagedObject { } @property (retain) NSString * title; @end
And this for the implementation:
@implementation Movie @dynamic title; @end
This in the controller:
- (IBAction)testTitle:(id)sender { Movie* movie; movie = [NSEntityDescription insertNewObjectForEntityForName:@"Movie" inManagedObjectContext:self.managedObjectContext]; movie.title = @"My Movie"; [movie setTitle:@"My Movie 2"]; NSLog(@"%@", movie.title); }
It prints "My Movie 2" and no exceptions are raised. Are you sure your model is correct?