From: Laurent S. <lsa...@ap...> - 2007-12-03 15:46:41
|
Hi Tim(s) :-) I suspect the ObjC-only project build is configured for a 10.4 deployment, where the exception won't be raised for compatibility reasons. I didn't try it though, but I think that if you build for 10.5 you will get the exception. Cheers, Laurent On Dec 3, 2007, at 4:55 AM, Tim Burks wrote: > Hi Laurent, > > Thanks, but that doesn't seem to explain why Tim's ObjC-only example > didn't suffer the exception. I've seen the same thing with ObjC-only > applications. You're the only one of us who can see the code in > question -- what's going on? > > best regards (and congratulations, btw!), > > Tim > > On Dec 2, 2007, at 4:32 PM, Laurent Sansonetti wrote: > >> On Dec 3, 2007, at 1:20 AM, Tim Burks wrote: >> >>> >>> Hi Tim, >>> >>> Your post reminded me of a problem that I recently had while working >>> with Nu. So I ported your example to Nu and saw the same message. >>> I think the problem is in the PSMTabBarControl framework. If you >>> look at PSMTabBarControl.m, you'll see this method: >>> >>> - (void)tabViewDidChangeNumberOfTabViewItems:(NSTabView *)aTabView >>> { >>> NSArray *tabItems = [tabView tabViewItems]; >>> // go through cells, remove any whose representedObjects are not >>> in [tabView tabViewItems] >>> NSEnumerator *e = [_cells objectEnumerator]; >>> PSMTabBarCell *cell; >>> while(cell = [e nextObject]){ >>> if(![tabItems containsObject:[cell representedObject]]){ >>> [self removeTabForCell:cell]; >>> } >>> } >>> ... >>> >>> This method is, in fact, mutating the _cells collection while it is >>> enumerating it. I've heard that Leopard treats this more strictly, >>> so that might explain the exception. I modified this method, >>> replacing the call that creates the object enumerator with this: >>> [...] >> >> Definitely, good catch! >> >> FYI, the rationale behind this new exception is explained in http://developer.apple.com/releasenotes/Cocoa/Foundation.html >> in the "Warning about mutations during enumerations" section. >> >> Laurent >> >> ------------------------------------------------------------------------- >> SF.Net email is sponsored by: The Future of Linux Business White >> Paper >> from Novell. From the desktop to the data center, Linux is going >> mainstream. Let it simplify your IT future. >> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 >> _______________________________________________ >> Rubycocoa-talk mailing list >> Rub...@li... >> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |