• 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: Linking xib's
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking xib's


  • Subject: Re: Linking xib's
  • From: Charlie Dickman <email@hidden>
  • Date: Thu, 17 Dec 2009 15:46:37 -0500

OK. From the controller I want to invoke a method in the view.

In the controller I declare an id called myView...

   id myView;

In the Controller's "didReceiveMemoryWarning I want to call a method in the view thusly...

   [myView cleanMemory];

The question is how does the id myView get the address of myView. When both the controller and the view are in the same xib I have IB resolve the myView reference by tagging it with an IBOutlet tag so that IB will recognize it and then I ctrl-drag the view to the IBOutlet in the controller.

The question is how do I provide this linkage when the controller and the view are in _different_ xib's?

On Dec 17, 2009, at 1:02 PM, Quincey Morris wrote:

> On Dec 16, 2009, at 13:20, Charlie Dickman wrote:
>
>> When the didReceiveMemoryWarning notification is sent to the controller I want to invoke a method in the main view. This means linking an IBOutlet in the controller (which has its own xib) to a method defined in the view (which has its own xib).
>
> Your question makes no sense because of the fuzziness of "linking an IBOutlet ... to a method". IBOutlets point to objects, they don't "link" to methods, and they're only connected automatically during nib loading (even on MacOS), from the object with the outlet to another object, when:
>
> 1. both objects are in the same nib, or
>
> 2. the first object is File's Owner and the second object is in the owned nib file.
>
>> Apparently this CAN NOT be done when the xib's are loaded and must be done in the code itself. In OSX this can be accomplished by telling the NSBundle to load the necessary nib but simply loading an xib in the iPhone OS doesn't resolve the IBOutlet.
>
> This is also a bit fuzzy, and appears to me to be false (concerning Mac OS X) as it stands. However, I'm not sure I understand what IBOutlet-setting mechanism you're describing.
>
>
> _______________________________________________
>
> 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

Charlie Dickman
email@hidden



_______________________________________________

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: Linking xib's
      • From: Shawn Erickson <email@hidden>
References: 
 >Linking xib's (From: Charlie Dickman <email@hidden>)
 >Re: Linking xib's (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: understanding the column of a double clicking into a table view
  • Next by Date: Re: understanding the column of a double clicking into a table view
  • Previous by thread: Re: Linking xib's
  • Next by thread: Re: Linking xib's
  • Index(es):
    • Date
    • Thread