Re: Linking xib's
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