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

NSEnumerator


  • Subject: NSEnumerator
  • From: Adam Johnson <email@hidden>
  • Date: Fri, 27 Jan 2006 15:09:53 -0500

-(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;
	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


  • Follow-Ups:
    • Re: NSEnumerator
      • From: Andy Lee <email@hidden>
    • Re: NSEnumerator
      • From: Daniel Jalkut <email@hidden>
    • Re: NSEnumerator
      • From: Clark Cox <email@hidden>
  • Prev by Date: Re: BEEP protocol
  • Next by Date: Re: NSEnumerator
  • Previous by thread: Re: BEEP protocol
  • Next by thread: Re: NSEnumerator
  • Index(es):
    • Date
    • Thread