• 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: NSEnumerator
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSEnumerator


  • Subject: Re: NSEnumerator
  • From: Clark Cox <email@hidden>
  • Date: Fri, 27 Jan 2006 15:24:15 -0500

You have one semicolon too many

On 1/27/06, Adam Johnson <email@hidden> wrote:
> -(id)init;
> {
>         items = [[NSMutableArray array] retain];
>         [items addObject:[[NSImage alloc] init]];
>         [items addObject:[[NSImage alloc] init]];
>         [items addObject:[[NSImage alloc] init]];
>         [items addObject:[[NSImage alloc] init]];
>         return self;
> }
> -(void)doSomethingTrivial:(id)sender;
> {
>         NSEnumerator *enumerator = [items objectEnumerator];
>         NSImage *aCell;

Remove the semicolon from this line:

>         while(aCell = [enumerator nextObject]);
>         {
>                 int index = [items indexOfObject:aCell];
>                 NSLog(@"%i %i",[items indexOfObject:aCell],[items count]);
>         }
> }
>
> The NSLog() prints something in the 4 billion ballpark.  Also, the
> enumerator only enumerates the first object.  What am I doing wrong?
>
> --Adam Johnson
>
>  _______________________________________________
> 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
>


--
Clark S. Cox III
email@hidden
My CV/Resume:
http://homepage.mac.com/clarkcox3/files/Resume.pdf
http://homepage.mac.com/clarkcox3/files/Resume.html
 _______________________________________________
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

References: 
 >NSEnumerator (From: Adam Johnson <email@hidden>)

  • Prev by Date: NSEnumerator
  • Next by Date: Re: BEEP protocol
  • Previous by thread: NSEnumerator
  • Next by thread: Re: NSEnumerator
  • Index(es):
    • Date
    • Thread