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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Tutorials > Tutorial Requests

Reply
 
LinkBack Thread Tools Display Modes
Old 08-11-2008, 05:17 AM   #1 (permalink)
Registered Member
 
chuck's Avatar
 
Join Date: Aug 2008
Location: Berlin, Germany
Posts: 87
Default simple UISearchBar and UITextView app

I'd like to see a tutorial which shows a UISearchBar as well as a UITextView where you type something in the UISearchBar and it appears in the UITextView as you type it.

I've pulled my hair out over this and am now redesigning my app with a text field and button because I can't get my head around UISearchBarDelegate and how it integrates with UISearchBar. Apple has an official example, except that it's very complicated. My post detailing my frustrations can be found here: http://www.iphonedevsdk.com/forum/ip...html#post12603

If anyone could do this screencast, I would highly appreciate it!
chuck is offline   Reply With Quote
Old 08-12-2008, 09:04 PM   #2 (permalink)
I live @ iDevKit.com
 
Join Date: Jul 2008
Posts: 142
Default

Implement the UISearchBar delegate method: - (void)searchBarUISearchBar *)searchBar textDidChangeNSString *)searchText.

then just use myTextView.text = searchBar.text whenever that method gets called.

Max
mxweas is offline   Reply With Quote
Old 08-13-2008, 01:21 AM   #3 (permalink)
Registered Member
 
chuck's Avatar
 
Join Date: Aug 2008
Location: Berlin, Germany
Posts: 87
Default

Thanks for the answer. However, I already know the code to make this work, I just can't set up the structure of the classes right to make it work. I'm not sure how I'm supposed to create the controller to interface with the UIView, because I noticed I can't add this delegate code directly to the UIView itself. Perhaps what I really need is a good tutorial on MVC on iPhone. I understand it on Rails, but it seems to be strangely implemented in Objective-C (to me at least). I'm going to go look at the Interface Builder tutorials again...
chuck is offline   Reply With Quote
Old 08-14-2008, 12:17 AM   #4 (permalink)
I live @ iDevKit.com
 
Join Date: Jul 2008
Posts: 142
Default

MVC on iPhone has no specific form. On Rails you are forced to keep everything separate where as in objc your view controller could be your model if you wanted it to. You are free to put code wherever you want because everything from views to foundation subclass's are objc.

Max
mxweas is offline   Reply With Quote
Old 01-19-2009, 12:26 AM   #5 (permalink)
New Member
 
Join Date: Jan 2009
Posts: 2
Default

Did you set the delegate for the searchbar in IB to the file's owner? That's what tripped me up at first.
raigatx is offline   Reply With Quote
Reply

Bookmarks

Tags
tutorial, uisearchbar, uisearchbardelete, uitextview

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: 265
16 members and 249 guests
@sandris, ADY, Alsahir, dacapo, Dani77, Desert Diva, djohnson, HemiMG, jansan, JasonR, MarkC, prchn4christ, ryandb2, smethorst, tomtom100
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,762
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

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