Re: SearchBar doesn't display at all
Re: SearchBar doesn't display at all
- Subject: Re: SearchBar doesn't display at all
- From: Matt Neuburg <email@hidden>
- Date: Wed, 8 Dec 2010 10:29:24 -0800
On Dec 8, 2010, at 10:01 AM, Jonathan Schmidt wrote:
> Thank you for the reply, Matt. I feel like we are getting somewhere!
>
> First, we are agreed that the SearchDisplayController doesn't actually
> display anything. I simply mentioned it because by dragging the
> SearchDisplayController onto the TableView, it automatically creates the
> SearchBar for me.
No, you cannot drag a search display controller onto a table view in a nib. I think you have it backwards! If you drag a search bar onto a table view in a nib, it puts the search bar in the header view and creates the search display controller for you - which is exactly what you want.
>
> Second, I am not sure that the case is that I have a SearchBar floating
> around in the NIB. It was added directly to the TableView in the NIB. In
> the NIB browser, it appears as a child of UITableView.
What does that mean: "as a child"? If you have done this right, the search bar should be the table view's header view, and you should see it in the table view's header in the nib.
>
> Perhaps there is some fundamental misunderstanding on my part with how
> NIBs are supposed to work?
I suppose there must be a fundamental misunderstand of something. If there were not, surely you would *know* what was going on and wouldn't need to ask your initial question - isn't that so?
>
> If I understand your message, it sounds as though you are saying that
> because I have the class defined as a UITableViewController that it will
> automatically ONLY instantiate a blank UITableView without using the NIB
> at all? If that is what you are saying, that seems completely
> counterintuitive when you consider that I can go to "Add -> New File ->
> Cocoa Touch Class -> UIViewController subclass -> UITableViewController
> subclass AND With XIB for user interface". Shouldn't that generate a
> class that automatically uses the associated XIB?
That depends what you mean by "automatically uses". It uses it if you tell it to use it.
>
> Now for the real question, assuming I understand the situation you are
> describing, how do I get it to use my NIB instead of a blank TableView?
Well, what are you doing *now*? How are you instantiating this UITableViewController subclass? It's up to you to tell it where its nib is. UITableViewController does *not* inherit the automagic ability of a UIViewController to find its nib without being told its name. (To be sure, I regard this as a bug in the framework, but that's a different story.) m.
--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Exploring & Customizing Snow Leopard
http://tinyurl.com/kufyy8
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
_______________________________________________
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