Using Delegation in communicating data between two controllers....
Using Delegation in communicating data between two controllers....
- Subject: Using Delegation in communicating data between two controllers....
- From: "Frederick C. Lee" <email@hidden>
- Date: Fri, 14 Aug 2009 14:24:22 -0700
Environment: iPhone (but Cocoa as well)... I was using the App Delegate
as the link amongst view controllers in sharing data. The 'App Delegate',
being persistent,
was my 'global data' clearing house.
But now I learned that this is frown upon. The preferred way is using
delegation to share data.
>From what I've read, delegation is essentially shared procedures via an
informal protocol; albeit the preferred design is to use
the formal protocol with @optional & @required directives.
I think I understand the basics.
But I wonder, how is data actually SHARED between a view controller and its
delegate?
The view controller has an ivar of type 'id' for the delegate, which has
methods declared within the protocol.
Here's some elementary questions:
1) How is the delegate actually launched (with valued parameters)?
2) How does the calling controller receive data back from the delegate?
Regards,
Ric.
_______________________________________________
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