A wierd problem when enumerating a second time
A wierd problem when enumerating a second time
- Subject: A wierd problem when enumerating a second time
- From: Jeffrey Drake <email@hidden>
- Date: Thu, 26 Dec 2002 01:28:25 -0500
When I do this in an NSView subclass:
- (void)drawRect:(NSRect)aRect
{
id planetEnumerator;
id planet;
planetEnumerator = [[[[self manager] starMap] stars] objectEnumerator];
[[NSColor whiteColor] set];
NSLog(@"-----------------------------------------------------");
NSLog(@" Number of Planets: %d", [[[[self manager] starMap] stars]
count]);
NSLog(@"-----------------------------------------------------");
while (planet = [planetEnumerator nextObject])
{
NSLog(@"Planet Location: %@", [planet objectForKey: @"Location"]);
//planet = [planet objectForKey: @"drawing"]; // stroke];
}
}
I get this:
2002-12-26 00:00:00.222 GalacticXtended[6384]
-----------------------------------------------------
2002-12-26 00:00:00.226 GalacticXtended[6384] Number of Planets: 50
(gdb) continue
2002-12-26 00:00:36.818 GalacticXtended[6384]
-----------------------------------------------------
2002-12-26 00:00:37.101 GalacticXtended[6384] Planet Location:
<43e00000 44004000 >
2002-12-26 00:00:37.101 GalacticXtended[6384] Planet Location:
<43400000 443c4000 >
2002-12-26 00:00:37.101 GalacticXtended[6384] Planet Location:
<44440000 442c4000 >
Summerized, as I imagine you get the point...
2002-12-26 00:00:37.101 GalacticXtended[6384] Planet Location:
<42d00000 43c48000 >
2002-12-26 00:00:37.101 GalacticXtended[6384] Planet Location:
<41c00000 43888000 >
2002-12-26 00:00:37.101 GalacticXtended[6384] Planet Location:
<42d00000 44204000 >
2002-12-26 00:00:37.109 GalacticXtended[6384] Planet Location:
<44100000 43dc8000 >
2002-12-26 00:00:43.834 GalacticXtended[6384]
-- done at this point, the initial 'draw' is complete.
Move scroll wheel up... and force a redraw...
-----------------------------------------------------
2002-12-26 00:00:43.834 GalacticXtended[6384] Number of Planets: 50
2002-12-26 00:00:43.834 GalacticXtended[6384]
-----------------------------------------------------
2002-12-26 00:00:43.852 GalacticXtended[6384] *** -[NSCFArray
objectForKey:]: selector not recognized
2002-12-26 00:00:43.864 GalacticXtended[6384] *** -[NSCFArray
objectForKey:]: selector not recognized
After stopping it in that while loop, on the second time around...
(gdb) po planet
<NSCFArray 0x275ef0>(
pict,
PICT,
pct,
PCT,
'PICT'
)
All of this code is available at
http://ezdrake.com/gx or complete
project:
http://ezdrake.com/GalacticXtended.tar.gz
SpaceView.h is the main class that this code is in.
Nobody in #macdev (opn) seems to know why this might be doing this. All
accessors and mutators are properly coded as far as I have been told.
Any help would be greatly appreciated,
Jeff
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.