Re: SearchBar doesn't display at all
Re: SearchBar doesn't display at all
- Subject: Re: SearchBar doesn't display at all
- From: Jonathan Schmidt <email@hidden>
- Date: Wed, 8 Dec 2010 13:01:34 -0500
- Acceptlanguage: en-US
- Thread-topic: SearchBar doesn't display at all
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.
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.
Perhaps there is some fundamental misunderstanding on my part with how
NIBs are supposed to work?
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?
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?
Jonathan
On 12/8/10 12:27 PM, "Matt Neuburg" <email@hidden> wrote:
>
>On Dec 8, 2010, at 8:58 AM, Jonathan Schmidt wrote:
>
>> The second NIB
>> DOES have a search bar, but it doesn't display at runtime.
>
>But we are agreed that this has nothing to do with the search display
>controller, right? That was just a red herring in your original email? In
>other words, what I'm trying to ascertain is that your question is really
>just this: You tap-tap to get the second view into the nav interface, and
>when it appears, it consists of a table view but no search bar.
>
>If that is the question, then the reason is that that's how your view
>controller is set up. The fact that a search bar is somewhere floating
>around in a nib is irrelevant. What's important is what view the view
>controller controls. If the view controller's view is a table view, that
>is what you'll see. If the view controller's view is a view containing a
>search bar and a table view, that is what you'll see.
>
>A common mistake, by the way, is this: Your view controller is a table
>view controller, and you misconfigure it so that it doesn't load any nib
>at all. You think you are loading a nib, but you aren't. The table view
>controller then by default creates its own table view. So the table view
>you end up seeing is not the table view in the nib. This has fooled many
>people (including me).
>
>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