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 09-29-2010, 08:46 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 6
KSoza is on a distinguished road
Default Creating an iPad Mail type UI using UISplitViewController

Hi, I'm trying to create an iPad application with a similar user interface to Apple's Mail application, i.e:

- RootView controller (table view) on the left hand side of the split view for navigation with a multiple view hierarchy. When a table cell is selected a new table view is pushed on the left hand side
- The new view on the left hand side can then update the detail view (potentially displaying a new view like the Apple MultipleDetailViews code sample).

I have modified the standard Xcode UISplitViewController template so that when a user selects a table cell from the left view it pushes a new table view in it's place (still on the left side). This works without issue, but I can no longer update the detail view using detailViewController.detailItem = [detailItem description];

I've also tried changing the MultipleDetailViews code sample, but have also had difficulty updating a label in the detail view.

Any help is appreciated, thanks!

Last edited by KSoza; 09-29-2010 at 08:49 AM.
KSoza is offline   Reply With Quote
Old 09-29-2010, 12:32 PM   #2 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 6
KSoza is on a distinguished road
Default Examples

Has anyone seen any examples of applications using the method I have described? - Multiple table views used on the left side of a splitViewController for navigation?

Or am attempting to do something that is only possible using private APIs?
KSoza is offline   Reply With Quote
Old 09-30-2010, 03:04 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 6
KSoza is on a distinguished road
Default

Anyone?

Is pushViewController removing the spliViewController from the view stack and therefore the UILabel is no longer accessible???
KSoza is offline   Reply With Quote
Old 09-30-2010, 08:13 AM   #4 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 6
KSoza is on a distinguished road
Default

For anyone who is interested in the solution (taken from another site):

"At some point after creating the RootViewController (or maybe even in a custom init method) you are setting the delegate for the DetailViewController, its a common mistake that when a new rootViewController is pushed onto the NavController that you forget to set the delgate again."

Here is the code:

newRootController.myDelegate = self.myDelegate;
KSoza is offline   Reply With Quote
Old 09-30-2010, 08:46 AM   #5 (permalink)
Registered Member
 
Join Date: Sep 2010
Location: Italy
Posts: 3
Metronic is on a distinguished road
Default

I'm trying to do the same application you described but I'm stuck,I can't even push a new view table.
Would you mind to post your source code?
It would be really helpful.Thanks

Quote:
Originally Posted by KSoza View Post
For anyone who is interested in the solution (taken from another site):

"At some point after creating the RootViewController (or maybe even in a custom init method) you are setting the delegate for the DetailViewController, its a common mistake that when a new rootViewController is pushed onto the NavController that you forget to set the delgate again."

Here is the code:

newRootController.myDelegate = self.myDelegate;
Metronic is offline   Reply With Quote
Old 10-01-2010, 03:00 AM   #6 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 6
KSoza is on a distinguished road
Default

I can't really post the entire code, but here is how the push table view part works:

Start a new "Select Split View-based Application" project, add a new ViewController to the project and name it something relevant, (remember to select UITableViewController subclass).

Find the RootViewController.m file and add this code:

#import "NewNavViewController.h" // name of your new ViewController

// add this part to the didSelectRowAtIndexPath delegate
NewNavViewController *newNavViewController = [[NewNavViewController alloc] initWithNibName:@"NewNavViewController" bundle:nil];
[self.navigationController pushViewController:newNavViewController animated:YES];
[newNavViewController release];

Run the app and it should work (make sure you have set up your new ViewController with some table view content).
KSoza is offline   Reply With Quote
Old 10-06-2010, 07:57 AM   #7 (permalink)
Registered Member
 
Join Date: Sep 2010
Location: Italy
Posts: 3
Metronic is on a distinguished road
Thumbs up

Finally I figure out how to populate the tables.
I forgot to put the instruction: [rvController.tableView reloadData];

where rvController is the RootController of the UISplitViewController.
Without the previous instruction data won't be reloaded inside the table and you will see only an empty table.

Click HERE to download my source code.

If you want to populate the table with your data,just edit "data.plist".

Now I have to understand how to load onto the detailViewController a different UITable for every row I select in the rootViewController.
If someone have a clue how to do it,please post a solution.Source code would be much more appreciated

Thanks
Metronic is offline   Reply With Quote
Old 10-12-2010, 05:13 AM   #8 (permalink)
Registered Member
 
Join Date: Sep 2010
Location: Italy
Posts: 3
Metronic is on a distinguished road
Default

@Ksoza

Sorry if I bother you but I'm still trying to solve this problem(I want to push a new detail view when I select a table's row in the rootcontroller),and when I was looking for a solution a found a question you asked in Stackoverflow (iPad SplitViewController UI - Replicate Apple Mail App - Stack Overflow).
I can't understand how to use NSNotification...
Can you help me?Thanks
Metronic is offline   Reply With Quote
Old 10-16-2010, 12:39 PM   #9 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 6
KSoza is on a distinguished road
Default

I've posted a response explaining how I done it here - Updating DetailViewController from RootController - Stack Overflow

Last edited by KSoza; 10-16-2010 at 12:46 PM.
KSoza is offline   Reply With Quote
Old 01-31-2011, 04:46 PM   #10 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 7
petesavva is on a distinguished road
Default hi

hi everyone. new to the forum.
i followed what you did here and managed to get the new viewcontroller to be pushed.
but am having two issues, if you could help me with:
1. the row that is selected on the first view controller remains selected after the new controller is pushed. if i press the back button is still remains selected.

2. i've gone through IB and changed the navigation bar color to dark gray (steel)
if i push the controller back and forth in portrait, and then rotate the ipad to landscape, the navigationbar color defaults to silver.

can anyone help me these two probs?
thanks in advance.

PS.... as it works well, just curious:
if say, row4 is selected, I wanted a new detailview to be pushed into view, how would that be accomplished?
I tried the MultipleDetailView sample from Apple, but no luck.

Last edited by petesavva; 01-31-2011 at 05:53 PM.
petesavva is offline   Reply With Quote
Old 09-23-2011, 02:22 AM   #11 (permalink)
Registered Member
 
Join Date: Sep 2011
Posts: 1
daarshg is on a distinguished road
Default Thanks

Quote:
Originally Posted by Metronic View Post
Finally I figure out how to populate the tables.
I forgot to put the instruction: [rvController.tableView reloadData];

where rvController is the RootController of the UISplitViewController.
Without the previous instruction data won't be reloaded inside the table and you will see only an empty table.

Click HERE to download my source code.

If you want to populate the table with your data,just edit "data.plist".

Now I have to understand how to load onto the detailViewController a different UITable for every row I select in the rootViewController.
If someone have a clue how to do it,please post a solution.Source code would be much more appreciated

Thanks
@Metronic thanks a lot for the code...
Saved my efforts in reinventing the wheel.
daarshg is offline   Reply With Quote
Reply

Bookmarks

Tags
ipad, iphone, splitviewcontroller, user interface

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: 343
6 members and 337 guests
headkaze, mistergreen2011, nobstudio, Objective Zero, revg, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,655
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, pungs
Powered by vBadvanced CMPS v3.1.0

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