tags:

views:

1201

answers:

3

I built a very simple tab based app with 2 tabs, each tab tied to its own view controller.

Straightforward so far. I then create a simple IBOutlet on my 2nd view controller like so

#import <UIKit/UIKit.h>


@interface bViewController : UIViewController {
    IBOutlet UITextField *aField;
}
@property (nonatomic, retain) UITextField *aField;
@end

then i synthesize it in my .m file, then i go into my xib, drag a text field onto the view and then set the files owner to 'aField'.

Very textbook so far.

It builds, but when i run it and select the 2nd tab (which shows the view where i've linked the UITextfield IBOutlet), it throws this error.

warning: Unable to read symbols for "/System/Library/Frameworks/UIKit.framework/UIKit" (file not found).
warning: Unable to read symbols from "UIKit" (not yet mapped into memory).
warning: Unable to read symbols for "/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics" (file not found).
warning: Unable to read symbols from "CoreGraphics" (not yet mapped into memory).

which is VERY ODD because this only started happening recently. Any clues?

UPDATE:

I'm beginning to suspect a config error rather than a syntax error because these are stripped down samples i created just to demonstrate the problem. This fails only when i create a tab-based application.

if i do the EXACT same thing in a view-based application, it works fine.

A: 

Does the outlet work? Make sure you've got your binary linking to the UIKit and CoreGraphics frameworks. Did this error only appear when you added the second outlet? If you're using version control, can you go back and pinpoint when the problem started?

I did notice one thing, and I'm not sure if this will fix your problem, but you usually put the IBOutlet marker on the property, like this:

@property (nonatomic, retain) IBOutlet UITextField *aField;

It's possible the NIB loading system is getting confused between trying to assign the value to an instance variable versus a property.

Alex
A: 

This is a long shot, but maybe you somehow switched the SDK to Mac OS X SDK instead of an iPhone SDK. I believe the setting is available if you do Get Info on the project in Xcode -- make sure the base SDK is an iPhone SDK.

Daniel Dickison
i tried toggling between various versions of the iphone device and iphone simulator SDKs to no avail :(
NoCarrier
+1  A: 

Ok, classic n00b mistake. Apparently the error has nothing to do with linking to an IBOutlet. The problem stems from the fact that when working with a tab based application, you have to set the viewController class in both the view XIB AND on the tab strip itself.

NoCarrier