• 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
Using Delegation in communicating data between two controllers....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Using Delegation in communicating data between two controllers....
      • From: Evan M <email@hidden>
  • Prev by Date: Re: Title Bar of Key Window
  • Next by Date: Apple Event parameter types in Cocoa scripting
  • Previous by thread: Re: Title Bar of Key Window
  • Next by thread: Re: Using Delegation in communicating data between two controllers....
  • Index(es):
    • Date
    • Thread