• 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: A Challenge WAS Accessor method idioms...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A Challenge WAS Accessor method idioms...


  • Subject: Re: A Challenge WAS Accessor method idioms...
  • From: Jonathon Mah <email@hidden>
  • Date: Fri, 25 Mar 2005 05:48:47 +1030

On 25 Mar 2005, at 05:41, John Brownlow wrote:

CHALLENGE: I have introduced a simple and obvious bug into the code below. Can you find it?

...
- (void) insertObject: (id)anObject inThingsAtIndex: (unsigned int)index
{
id myThings = [self things];
unsigned int thingsCount = [myThings count];
if (index < thingsCount) return;

Of course, should be >.


I haven't looked into it, but how messy would it be to have a small list of method names that you'd use to forward invocations on to the array? You'd then have a reasonably compact and non-reduntant way of doing this.



Jonathon Mah email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: A Challenge WAS Accessor method idioms...
      • From: John Brownlow <email@hidden>
References: 
 >Accessor method idioms... (From: Mike Ferris <email@hidden>)
 >Re: Accessor method idioms... (From: John Brownlow <email@hidden>)
 >Re: Accessor method idioms... (From: "M. Uli Kusterer" <email@hidden>)
 >A Challenge WAS Accessor method idioms... (From: John Brownlow <email@hidden>)

  • Prev by Date: A Challenge WAS Accessor method idioms...
  • Next by Date: Re: Sliding views around
  • Previous by thread: A Challenge WAS Accessor method idioms...
  • Next by thread: Re: A Challenge WAS Accessor method idioms...
  • Index(es):
    • Date
    • Thread