• 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
(no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(no subject)


  • Subject: (no subject)
  • From: Adam Johnson <email@hidden>
  • Date: Thu, 26 Jan 2006 21:52:59 -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 enumeator only goes through 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: -doSomethingTrivial: (was empty subject line)
      • From: Andy Lee <email@hidden>
  • Prev by Date: Apple Finder team is hiring
  • Next by Date: NSWindow and app unhiding
  • Previous by thread: Re: Ink
  • Next by thread: Re: -doSomethingTrivial: (was empty subject line)
  • Index(es):
    • Date
    • Thread