On May 4, 2011, at 8:02 AM, Fritz Anderson wrote:

> On 4 May 2011, at 9:00 AM, Steve Christensen wrote:
> 
>> 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.
> 
> Have you verified that
> 
> 1) you are inspecting the outlets in the debugger at a time after the NIB has 
> loaded and the connections are made? -viewDidLoad would be favorite.

Yes, I put a breakpoint in -viewDidLoad, as well as just letting it run and 
crash, and then look at the instance variables in the debugger. At both places, 
the table is a UITableView and the other two outlets are nil.

> 2) Interface Builder knows that your table view is a MyTableView? Check the 
> identity inspector (third tab in the Utility area of Xc4, last tab (as I 
> remember it) in the floating inspector in IB/Xc3.

Yes, the Type field in the xib file's main window, as well as the Class field 
in the inspector window, show the type as MyTableView.

> 3) the other two outlets are actually connected?

Yes, the outlets tab in the inspector window shows the file owner/view 
controller's outlets to be all wired up. And moving the mouse over those items 
highlights the corresponding views in the main xib window.

> 4) File's Owner in the XIB for the controller is actually of the controller's 
> class?

Yes.

> 5) you are not instantiating your controller twice? The MainWindow.xib 
> template for tab-based targets does it; do you do it elsewhere yourself?

No, my MainWindow.xib has a tab bar controller that has a tab item referencing 
this view controller and its corresponding nib file.

> 6) the class of the controller for that tab (in MainWindow.xib) is declared 
> to be of the right class?

Yes, and the controller is being instantiated as expected.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to