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 01-10-2012, 11:06 AM   #1 (permalink)
iOS Dev
 
Join Date: Mar 2011
Location: Brazil
Age: 26
Posts: 103
gbergamo is on a distinguished road
Send a message via ICQ to gbergamo Send a message via MSN to gbergamo Send a message via Skype™ to gbergamo
Default Storyboard and tableView

Hi everyone!
I have a doubt here!
In my View I have a UITableView, 4 sessions and 1 cell in each session, ok! For each cell I want to specify what view controller I want to go.

Example
in session 0 cell 0 - I want to go to DetailViewController
in session 1 cell 0 - I want to go to HelpViewController

How can I do it?

thanks!
__________________
Vai de Que? - Car supplies Util - Download
iJob - Job search (Br) - Download
iReembolso Lite - Refound control free - Download
iReembolso - Refound control - Download
gbergamo is offline   Reply With Quote
Old 01-10-2012, 11:28 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 gbergamo View Post
Hi everyone!
I have a doubt here!
In my View I have a UITableView, 4 sessions and 1 cell in each session, ok! For each cell I want to specify what view controller I want to go.

Example
in session 0 cell 0 - I want to go to DetailViewController
in session 1 cell 0 - I want to go to HelpViewController

How can I do it?

thanks!
When you say "session," do you really mean section? Table views are in sections.

You need to implement the tableView:didSelectRowAtIndexPath: table view delegate method. In that method, use the indexPath parameter to figure out which cell the user tapped. Then you can push a new view controller (if you are using a navigation controller) or invoke a segue if not.

Since this sounds like a master/detail arrangement, it probably makes sense to put the view controller that contains your table view into a navigation controller, and move to your DetailViewController and HelpViewController with pushViewController:animated:. That way, you'll get a back button "for free", and will automatically return to the view controller with the table view when the user is done.
__________________
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
Old 01-10-2012, 01:43 PM   #3 (permalink)
iOS Dev
 
Join Date: Mar 2011
Location: Brazil
Age: 26
Posts: 103
gbergamo is on a distinguished road
Send a message via ICQ to gbergamo Send a message via MSN to gbergamo Send a message via Skype™ to gbergamo
Default

Quote:
Originally Posted by Duncan C View Post
When you say "session," do you really mean section? Table views are in sections.

You need to implement the tableView:didSelectRowAtIndexPath: table view delegate method. In that method, use the indexPath parameter to figure out which cell the user tapped. Then you can push a new view controller (if you are using a navigation controller) or invoke a segue if not.

Since this sounds like a master/detail arrangement, it probably makes sense to put the view controller that contains your table view into a navigation controller, and move to your DetailViewController and HelpViewController with pushViewController:animated:. That way, you'll get a back button "for free", and will automatically return to the view controller with the table view when the user is done.
Sorry! I write it wrong, I wanna said section.
Ok, so I have use the event tableView:didSelectRowAtIndexPath and depends the IndexPath I want, invoke the Segue, but how can I invoke a segue?

I did that so simple with navigation controller our without storyboard. lol

I was pushing the controller ABPeoplePickerNavigationController, and I was getting an error. Ok it works well when I push a "normal" controller, but how can I say that view (in storyboard) is the view of controller that I call?

thanks
__________________
Vai de Que? - Car supplies Util - Download
iJob - Job search (Br) - Download
iReembolso Lite - Refound control free - Download
iReembolso - Refound control - Download
gbergamo is offline   Reply With Quote
Old 01-10-2012, 06:49 PM   #4 (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 gbergamo View Post
Sorry! I write it wrong, I wanna said section.
Ok, so I have use the event tableView:didSelectRowAtIndexPath and depends the IndexPath I want, invoke the Segue, but how can I invoke a segue?

I did that so simple with navigation controller our without storyboard. lol

I was pushing the controller ABPeoplePickerNavigationController, and I was getting an error. Ok it works well when I push a "normal" controller, but how can I say that view (in storyboard) is the view of controller that I call?

thanks
For your application, I would suggest using a navigation controller, not segues. That way you can push a detail controller, the user can manipulate the content, then pop that view controller and go back to the table view.

You can save your navigation controller and all your other view controllers in your storyboard. Just use instantiateViewControllerWithIdentifier: when you want to create a new view controller, and use the resulting view controller in a call to the UINavigationController method pushViewController:animated:
__________________
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
storyboard, tableview

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: 385
10 members and 375 guests
Atatator, buggen, guusleijsten, j.b.rajesh@gmail.com, morterbaher, QuantumDoja, sacha1996, Sami Gh, tim0504, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,674
Threads: 94,122
Posts: 402,907
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Atatator
Powered by vBadvanced CMPS v3.1.0

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