On Jul 19, 2009, at 10:38, Trygve Inda wrote:

I have an AppController in my main nib. Also in this nib is a
TabBarController and several custom subclasses of UIViewController.

The TabBarController manages the custom subclasses of UIViewController.

However, these subcalsses need to be able to get back to the AppController . So for each subclass I have created an IBOutlet for the AppController and
linked them up in my main nib.

When a button action happens for example in one of the views, my IBOutlet
from the custom view class back to the AppController is nil.

Why... And how can I get a value here so that the view can call a method in
the AppController?

Even if I have the AppController pass self to a view controller and the
viewController stores it, later on, the value has reset to nil.

This sort of inexplicable behavior is almost always the result of creating two sets of objects, one set unarchived from the nib with the correct connections, and one created as a result of some of your code that doesn't have any connections.

Excuse me if I'm restating what you already know, but objects in nib files are real objects (re-created when the nib file is loaded), not placeholders that automatically match up with other objects. (Except of course for File's Owner, Application and First Responder, which *are* placeholders that automatically match up with other objects.)


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to