Re: Debugging Bindings
Re: Debugging Bindings
- Subject: Re: Debugging Bindings
- From: David Olbersen <email@hidden>
- Date: Fri, 28 Jan 2005 07:43:53 -0800
On Jan 28, 2005, at 12:30 AM, mmalcolm crawford wrote:
On Jan 28, 2005, at 12:22 AM, David Olbersen wrote:
3.B) The TWWorld tells the TWRobot to set it's location to where
the user clicked. ** The TWWorld then adds the TWRobot object to the
TWWorld's NSMutableArray (robots) using the addObjects: message **
First guess:
<http://homepage.mac.com/mmalc/CocoaExamples/controllers.html>
see "Programmatic modifications to arrays not noticed by table view".
w00t! No more "going behind the controller's back" for me! I've
replaced this simple code:
[robots addObject:newRobot];
with
NSMutableArray *tempRobots = robots;
[tempRobots addObject:newRobot];
[self setRobots:tempRobots];
and that works just fine.
As a nit-picky detail: is there any way I can get rid of the temporary
NSMutableArray? It's not like this list will get too large (no bigger
than a few hundered, generally in the dozens) but I'd like to avoid the
temporary variable if possible.
Thanks for your help mmalcolm!
--
David Olbersen
_______________________________________________
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