• 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: Key-Value-Observing and Collections
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Key-Value-Observing and Collections


  • Subject: Re: Key-Value-Observing and Collections
  • From: "David Symonds" <email@hidden>
  • Date: Thu, 25 Oct 2007 23:30:28 +1000

On 10/25/07, Philip Mötteli <email@hidden> wrote:
>
> - (void)setGrades:(NSMutableArray *)theGrades;
> - (NSMutableArray *)grades;
> - (void)addGrade:(Grade *)aGrade;

You probably want your addGrade method to look like:

- (void)addGrade:(Grade *)aGrade
{
        [self willChangeValueForKey:@"grades"];
        [grades addObject:aGrade];
        [self didChangeValueForKey:@"grades"];
}


Dave.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Key-Value-Observing and Collections (From: Philip Mötteli <email@hidden>)

  • Prev by Date: Key-Value-Observing and Collections
  • Next by Date: Re: NSLocalizedString and plural form
  • Previous by thread: Key-Value-Observing and Collections
  • Next by thread: Re: Key-Value-Observing and Collections
  • Index(es):
    • Date
    • Thread