iOS Multiple views on one view

youPhone

macrumors member
Original poster
Sep 8, 2008
41
0
I have a tab bar controller set up and it has navigation controller pages set each tab loads a separate xib

On the first tab, I want to load a screen (for lack of a better word) that has a view on the top half of the screen with some text, etc... and I also want to load a tableview on the bottom half of the screen (this is in addition to the nav bar on top and tab bar on bottom). I want the top view to stay on the screen while the tableview is permitting to scroll.

Can someone give me a bump in the right direction?

I have made the page with the tableview by itself using a tableViewController in its own xib, but I can't add the other top half view on there like that.

I've tried making just a viewcontroller with a top view and bottom table view and that will load with a blank table, but I'm uncertain how to get the data in there.
 

Niiro13

macrumors 68000
Feb 12, 2008
1,717
0
Illinois
I've tried making just a viewcontroller with a top view and bottom table view and that will load with a blank table, but I'm uncertain how to get the data in there.
What's wrong with that? Loading the data should be exactly the same as if the tableView was the only view. As in exactly the same.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
24,596
60
Harrogate
What's wrong with that? Loading the data should be exactly the same as if the tableView was the only view. As in exactly the same.
I don't really use the table view controllers but I think they might automatically set the datasource and delegate for the tableview to themselves. Using a standard view controller means you have to set these yourself (not hard).
 

Niiro13

macrumors 68000
Feb 12, 2008
1,717
0
Illinois
Yeah, I use table view controllers and they do set it to themselves (then again, I'm not advanced enough to use another file as a datasource :p)

To OP, all you need to do is to set the datasource and/or delegate property to your data file.
 

youPhone

macrumors member
Original poster
Sep 8, 2008
41
0
I was starting to write up another post trying to go through the steps and try to convey to you what I wasn't understanding, but fortunately, I found what I was not understanding. I didn't understand how I was supposed to set up the delegate.

In the MainWindow.xib, I needed to set the delegate for my view controller there to my navigation controller

I didn't have to touch the xib for that view controller either, it already had the delegate and dataSource pointing to the File's Owner

Can't believe I missed that earlier.

Thanks for all the help.