Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-12-2010, 02:20 PM   #1 (permalink)
TB2
Registered Member
 
Join Date: Aug 2010
Posts: 1
TB2 is on a distinguished road
Default UISearchBar and Keyboard magically disappear

Hello there.

I followed this guide on adding a UISearchBar to my UITableView.

But there's a problem if I do the following things in this order:
1) initiate search
2) search for something that appears in many entries (so that the list of results is longer than the screen)
3) scroll down the list of results until the UISearchBar is not on the screen anymore
4) tap on an item to view the details
5) tap back
--> Now the keyboard and the results list are gone!

If you have the time, you can easily reproduce the problem by downloading the unmodified, original xcode project and running it:
http://sites.google.com/site/iphones...attredirects=0

You can change line 22 of RootViewController.m to something like
Code:
NSArray *countriesToLiveInArray = [NSArray arrayWithObjects:@"Iceland", @"Greenland", @"Switzerland", @"Norway", @"New Zealand", @"Greece2", @"Greece3", @"Greece4", @"Greece5", @"Greece6", @"Greece7", @"Greece", @"Greece", @"Greece8", @"Greece9", @"Greece10", @"Greece11", @"Greece12", @"Greece13", @"Greece14", @"Italy", @"Ireland", nil];
to get a longer list, and then search for something like "Gree". Then scroll down to Greece12 or so, tap it, and go back and see the bug.

This does ONLY happen with the 4.0 Simulator, but not with the 3.2 one!

Does anyone have a clue why this is happening? It's really odd and I can't figure out what is going wrong. I don't have a device yet so I wasn't able to try out the behaviour there.

I'd be very grateful if someone could download and inspect said project and try reproducing the bug. I'm clueless.

Thanks everyone!
TB2 is offline   Reply With Quote
Old 08-29-2010, 08:00 AM   #2 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 6
ChristianK is on a distinguished road
Default

I have exactly the same problem.
The search bar disappers, if the keyboard is opened and the search bar is scrolled out of view.
It also occurs on a real device (tested with latest iPod touch, iOS 4.0).
ChristianK is offline   Reply With Quote
Old 10-14-2010, 06:48 PM   #3 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 1
yummyyellow is on a distinguished road
Default

I fixed it by doing this:

Code:
- (void)viewDidAppear:(BOOL)animated {
     [super viewDidAppear:animated];
     self.tableView.tableHeaderView = _searchBar;
     [_searchBar becomeFirstResponder];
}
Code:
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
     [_searchBar resignFirstResponder];
     self.tableView.tableHeaderView = _searchBar;
}

Last edited by yummyyellow; 10-14-2010 at 06:52 PM.
yummyyellow is offline   Reply With Quote
Reply

Bookmarks

Tags
disappeared, disappears, search, uisearchbar, uitableview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 355
5 members and 350 guests
bignoggins, Chickenrig, givensur, linkmx, PlutoPrime
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,894
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:44 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0