Re: iOS nib weirdness...
Re: iOS nib weirdness...
- Subject: Re: iOS nib weirdness...
- From: Alexander Spohr <email@hidden>
- Date: Wed, 04 May 2011 16:47:12 +0200
Is your viewController a subclass of UITableViewController?
Then your nib is not loaded.
UITableViewController is broken. It does not keep the contract of initWithNibName:bundle:
atze
Am 04.05.2011 um 16:00 schrieb Steve Christensen:
> I'm working on an app that uses a tab bar. I created a new nib to set up a view+controller and added a new tab item to the main nib that references the controller and the controller's nib, plus I filled in some basic functionality in the view controller. Since it's relevant, the controller's IBOutlets are
>
> IBOutlet MyTableView* _resultsTable;
> IBOutlet UIActivityIndicatorView* _searchActivityIndicator;
> IBOutlet UISearchBar* _searchBar;
>
> When I ran the app and used the new view's UI, I got an unexpected "unrecognized selector" exception when trying to access a custom method in _resultsTable. When I looked at their values in the debugger, I found that _resultsTable was an instance of UITableView, not MyTableView; and _searchActivityIndicator and _searchBar were both nil.
>
> I thought that there could be a missing class issue, but the MyTableView class is implemented since creating a test MyTableView instance in code works just fine. That still doesn't explain the other nil values since all three views were wired up in IB: the view controller shows the views connected to the outlets and the views show themselves as connected.
>
> Grasping at straws, I trashed the build results and did a clean build, and even re-launched Xcode, with no difference in behavior. I could very well be doing something dumb but I'm not exactly sure where to look since I've (correctly) set up this same sort of thing before and it worked fine. BTW, I'm using Xcode 3.2.6 + iOS SDK 4.3. Any ideas?
>
> steve
>
> _______________________________________________
>
> 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
_______________________________________________
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