• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSArrayController help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Why can't I instantiate a subclass of NSArrayController?
  • Next by Date: Re: Variables: Why one way and not another?
  • Previous by thread: Re: Why can't I instantiate a subclass of NSArrayController?
  • Next by thread: Re: NSArrayController help
  • Index(es):
    • Date
    • Thread