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 06-15-2010, 07:32 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 1
tfritsch is on a distinguished road
Default Help With UITableView as a SubView

I am trying to create a view that poses a question in a label and has a subview of a table for multiple choice answers. The view controller is set as the tableview DataSource and Delegate.

Currently, the form displays correctly and when the user clicks on an answer in the table, I can get it to change to the next question and update the table with the new multiple choices. (i.e., the table is acting as the navigation control). This works well but not the best for user experience and overall UI navigation consistency with the rest of the app.

What I would prefer is to not have the table working as a navigation control. To instead place a checkmark next to the answer and then have a button that will move to the next question and reload the table.

So, the button will call -(void) showNextQuestion which gets the new data and updates the view labels for the question. I try to call [self.tableView reloadData] but it is not declared outside of the predefined methods for the tableviewController.

So basically, how can I show a simple list of values in a subview table on a view, allow a selection to occur, providing the index of the item selected and have a button that will update the contents of that table?

I have thought aboutputting the button inside of the table but I want the navigation to stay with a button on the view.

Any ideas or direction would be appreciated.
tfritsch is offline   Reply With Quote
Old 06-15-2010, 08:26 AM   #2 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by tfritsch View Post
I am trying to create a view that poses a question in a label and has a subview of a table for multiple choice answers. The view controller is set as the tableview DataSource and Delegate.

Currently, the form displays correctly and when the user clicks on an answer in the table, I can get it to change to the next question and update the table with the new multiple choices. (i.e., the table is acting as the navigation control). This works well but not the best for user experience and overall UI navigation consistency with the rest of the app.

What I would prefer is to not have the table working as a navigation control. To instead place a checkmark next to the answer and then have a button that will move to the next question and reload the table.

So, the button will call -(void) showNextQuestion which gets the new data and updates the view labels for the question. I try to call [self.tableView reloadData] but it is not declared outside of the predefined methods for the tableviewController.

So basically, how can I show a simple list of values in a subview table on a view, allow a selection to occur, providing the index of the item selected and have a button that will update the contents of that table?

I have thought aboutputting the button inside of the table but I want the navigation to stay with a button on the view.

Any ideas or direction would be appreciated.

What you describe should work. What do you mean when you say "... but it is not declared outside of the predefined methods for the tableviewController."

Is your view controller a subclass of UITableView? It should be. Note that you can manage a table view yourself. You don't have to have a table view controller. A table view controller doesn't do much, and that behavior is easy to duplicate.

A UITableViewController has a property TableView. You can (and should) use a subclass of UITableViewController to manage your entire screen, including the buttons, labels, etc. The special tableview methods will take care of the housekeeping methods for the table view, and your custom methods will manage everything else.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Reply

Bookmarks

Tags
reloaddata, reloaddata tableview, subview, 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: 335
9 members and 326 guests
Absentia, Domele, fiftysixty, givensur, heshiming, linkmx, michaelhansen, PixelInteractive, Sloshmonster
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,892
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:13 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0