Re: NSArrayController help
Re: NSArrayController help
- Subject: Re: NSArrayController help
- From: Mike Nowak <email@hidden>
- Date: Sat, 1 Nov 2003 10:52:20 -0500
Thanks that helps. I was able to get it to work by overriding addObject
but overriding newObject makes more sense.
On Nov 1, 2003, at 1:53 AM, mmalcolm crawford wrote:
Subclass NSArrayController and override - (id)newObject
<http://homepage.mac.com/mmalc/CocoaExamples/AddaYear.zip>
mmalc
@implementation YearAddArrayController
- (id)newObject
{
NSCalendarDate *year = [self
valueForKeyPath:@"email@hidden"];
NSCalendarDate *yearPlusOne = [year dateByAddingYears:1 months:0
days:0 hours:0 minutes:0 seconds:0];
id newObj = [super newObject];
[newObj setValue:yearPlusOne forKey:@"year"];
return newObj;
}
@end
--
Mike Nowak
Work:
http://healthmedia.umich.edu/
Personal:
http://snackdog.org/
"Embrace your inner biker."
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.