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

View Single Post
Old 08-30-2008, 10:29 PM   #3 (permalink)
bhil
New Member
 
Join Date: Aug 2008
Posts: 17
Default

Quote:
Originally Posted by indiekiduk View Post
You are missing a few steps here. I think your main mistake is this:
"Right click on Classes...Add...New File...UIViewController subclass and name it SecondViewController."
You should be adding a new UITableViewController subclass instead. It has a tableView field already and it is automatically hooked up to the first table in the xib you don't need to hook it up. You do however need to connect the delegate and the data source to the file's owner in the xib, and of course connect the file owner's view to the table .

Watch my video carefully which has 2 tables in a tab bar.
Thanks, this helped. I left the datasource and delegate out of the example because they were irrelevant to showing the exception. Following your example I can make things work, but I'm still not sure why the other way doesn't work. In my first example I am using a UIViewController and it works so why can't I do it in the second example?

More specifically, following your way only seems to work if the entire view is a table. I want a view in the second tab that has a search bar at the top, with a table taking the rest of the view and the only way IB lets me do that is if I am using a UIView, not a UITableView as the base view, and if I do that, I get errors saying the controller is expecting a UITableView. The only way to get rid of the errors is to switch the controller to a UIViewController (instead of UITableViewController as you suggest), which puts me right back at the spot I was in for my second demo.

I'm sure there's an easy way to do what I want, it just escapes me what it is. Is there a way to add another object to IB that I can connect my table view to? So I could have a UIViewController as the File's Owner, being the delegate and outlet for the search view, and then a second object that is a UITableViewController that is the delegate, datasource and outlet for the UITableView? Or am I trying to make things too complicated?
bhil is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,722
Threads: 89,177
Posts: 380,494
Top Poster: BrianSlick (7,123)
Welcome to our newest member, idny99
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:30 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.