• 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
Re: Debugging Bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Debugging Bindings
      • From: Guy English <email@hidden>
    • Re: Debugging Bindings
      • From: Shawn Erickson <email@hidden>
References: 
 >Debugging Bindings (From: David Olbersen <email@hidden>)

  • Prev by Date: Re: NSDocument/NSSavePanel and controlling filenames
  • Next by Date: Re: Debugging Bindings
  • Previous by thread: Re: Debugging Bindings
  • Next by thread: Re: Debugging Bindings
  • Index(es):
    • Date
    • Thread