Re: A Challenge WAS Accessor method idioms...
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