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 Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-29-2008, 05:09 PM   #1 (permalink)
New Member
 
Join Date: Dec 2008
Posts: 9
Unhappy Inserting table on part of a view using IB?

Hi,

I am new to iPhone development, having just gone thru the Mark-LaMarche book.

The application is a tab-bar app, with each of the tabs in turn linking to a navigation controller, each in their own nib.

The problem I am facing is this. On the Navigation Controllers that are extensions of UIViewControllers (let's call one myNavRootController), I still have to insert a table on PART of the view.

So I created another extension of a UITableViewController (let's call it mySmallTableController), and then dropped a Table View using the Interface Builder on top of the View associated with myNavRootController. How do I link this Table to mySmallTableController?

Alternatively, I dropped a Table View Controller into the NIB, and linked its class to mySmallTableController. This controller has its own Table View. How do I make this table view show up on the View of the myNavRootController?

Your help much appreciated. I am heavily relying on IB, since my Objective-C skills are nascent.

The only alternative I can think of is to make the whole myNavRootController View a grouped table view with two sections, show the rows in the top section, and make the bottom section one giant row where I can place other controls as needed by implementing a custom cell view from a new nib.

Thank you!
gtur is offline   Reply With Quote
Old 12-29-2008, 06:24 PM   #2 (permalink)
New Member
 
Join Date: Dec 2008
Posts: 9
Default

Some progress. I changed the myNavRootController declaration to support <UITableViewDelegate, UITableViewDataSource>, copied some methods from a "normal" Table View Controller (mySmallTableController), and in IB, pointed the dataSource and delegate of the Table View within the View associated with myNavRootController to point to the File Owner. So far the cells are showing up fine
gtur is offline   Reply With Quote
Old 12-29-2008, 10:41 PM   #3 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 4,814
Default Using a UITableView inside another view

Quote:
Originally Posted by gtur View Post
Some progress. I changed the myNavRootController declaration to support <UITableViewDelegate, UITableViewDataSource>, copied some methods from a "normal" Table View Controller (mySmallTableController), and in IB, pointed the dataSource and delegate of the Table View within the View associated with myNavRootController to point to the File Owner. So far the cells are showing up fine
gtur,


I just figured this out today. What I did is to create a custom UITableViewController class. I created a UITableViewController at the root level of my nib, and set it's type to my custom controller class.

I deleted the table view object that IB creates inside the controller. Then I dragged a table view object onto the view where I wanted it. Finally, I connected up the delegate and data source outlets from the table view to the controller, and then set the view outlet of the controller to point to the view. It works.

Duncan
Duncan C is offline   Reply With Quote
Old 01-01-2009, 06:51 PM   #4 (permalink)
New Member
 
Join Date: Dec 2008
Posts: 9
Default Thank you.

Your approach is seems simpler than mine. Happy New Year!
gtur is offline   Reply With Quote
Reply

Bookmarks

Tags
table view, tableviewcontroller

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: 255
24 members and 231 guests
ADY, AragornSG, bookesp, chillyh, dacapo, Dani77, Davey555, Desert Diva, Dominus, dre, glenn_sayers, HemiMG, JasonR, LEARN2MAKE, M.A.S., marshusensei, mer10, nobre84, Oral B, prchn4christ, Raggou, Rudy, spiderguy84, themathminister
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,765
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

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