• 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: Communication between objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Communication between objects


  • Subject: Re: Communication between objects
  • From: David LeBer <email@hidden>
  • Date: Wed, 11 Feb 2009 11:31:20 -0500


On 11-Feb-09, at 11:14 AM, Jason Wiggins wrote:

OK, now I *think* I've got a bit idea. What I've been trying to do is get an ivar from object1 into object2 *directly* without using the controller as a "middleman"
Is it true that I have to set up properties (using Objc 2) to get and set the ivars *via* the controller? I just did that and got it to work.
Can i only communicate between objects via the controller who (as obviously named) it controls the flow of data?
The only reason I ask this is because after reading Object-Oriented Programming with Objective-C - The Object Model - Figure 3-2 "The object network" shows each object sending messages to each other. Is that picture very abstracted? Because if it is, that figure has messed with my brain.

I think this has been explained.

It is perfectly acceptable for model objects to message one another.

You just need to have a reference to the object you are trying to message. i.e.:

	Company <-->> Employees

Your Company object would have an array of Employees. The Employee objects would each have a reference to their Company.

	From Company: [[[self employees] objectAtIndex:n] doThatThing];
	From Employee: [[self company] doThatOtherThing];


On 12/02/2009, at 02:56 , I. Savant wrote:

On Wed, Feb 11, 2009 at 10:42 AM, Jason Wiggins
<email@hidden> wrote:

I understand MVC ...

Sorry, but I disagree. You've still got some concepts missing. :-)


;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: 	http://codeferous.com
blog: 	http://davidleber.net
profile:	http://www.linkedin.com/in/davidleber
twitter:	http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Communication between objects (From: Jason Wiggins <email@hidden>)
 >Re: Communication between objects (From: Clint Shryock <email@hidden>)
 >Re: Communication between objects (From: Jason Wiggins <email@hidden>)
 >Re: Communication between objects (From: "I. Savant" <email@hidden>)
 >Re: Communication between objects (From: Jason Wiggins <email@hidden>)

  • Prev by Date: Re: Communication between objects
  • Next by Date: Re: Which keyboard (barcode scanner) did the event come from?
  • Previous by thread: Re: Communication between objects
  • Next by thread: RE: Communication between objects
  • Index(es):
    • Date
    • Thread