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 03-08-2011, 10:58 AM   #1 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: VA
Posts: 50
zambono is on a distinguished road
Default multiple master and detail views in iPad split view, uisplitview

Thanks ahead of time. I am currently developing the iPad version of an app which on the iphone has 3 tabs,which each load 3 different rss feeds and then drill down to details with a navigation controller on the iPhone. On the iPad what makes sense is that I join 2 of the feeds in the first splitview, and then have a separate master and detail for the 3rd feed.

what is the best practice to accomplish this. I currently have setup a toolbar button in the first detailview, which calls the appdelegate which switches the master and detail as so

Code:
- (void)switchViews {

    VideoSelectorViewController *masterViewController = nil;
    VideoDetailiPadViewController *detailViewController = nil;
    UIViewController *tempDetail = [self.splitViewController.viewControllers objectAtIndex:1];
    UIViewController *tempMaster = [self.splitViewController.viewControllers objectAtIndex:0];
    [tempDetail.view removeFromSuperview];
    [tempMaster.view removeFromSuperview];
    [tempDetail release];
    [tempMaster release];
    tempDetail = nil;
    tempMaster = nil;

  //  if (row == 1) {
        VideoSelectorViewController *newMasterViewController = [[VideoSelectorViewController alloc] initWithNibName:@"VideoSelectorViewController" bundle:nil];
        masterViewController = newMasterViewController;

        VideoDetailiPadViewController *newDetailViewController = [[VideoDetailiPadViewController alloc] initWithNibName:@"VideoDetailiPadViewController" bundle:nil];
        detailViewController = newDetailViewController;

  //  }

    // Update the split view controller's view controllers array.
    NSArray *viewControllers = [[NSArray alloc] initWithObjects:masterViewController, detailViewController, nil];
    self.splitViewController.viewControllers = viewControllers;
    [viewControllers release];

/*  // Dismiss the popover if it's present.
    if (popoverController != nil) {
        [popoverController dismissPopoverAnimated:YES];
    }*/

    // Configure the new view controller's popover button (after the view has been displayed and its toolbar/navigation bar has been created).
   // if (detailViewController.popover != nil) {
        [detailViewController showRootPopoverButtonItem:detailViewController.rootPopoverButtonItem];
    //}

    [masterViewController release];
    [detailViewController release];


}
this works ok when the iPad is in landscape but on portrait the barbutton does not show up in the toolbar, how can i call - (void)splitViewController: (UISplitViewController*)svc willHideViewController programmatically? Also memory management for my method, should i release and set to nil the previous master and detail as I am with those temp objects in my switchViews method?

The other method is to push the new master on to the old, and just replace the detail. which is better, memory wise, performance, etc. thanks again
zambono is offline   Reply With Quote
Old 03-08-2011, 02:47 PM   #2 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: VA
Posts: 50
zambono is on a distinguished road
Default

bump
zambono is offline   Reply With Quote
Old 03-09-2011, 10:09 AM   #3 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: VA
Posts: 50
zambono is on a distinguished road
Default

bump
zambono is offline   Reply With Quote
Reply

Bookmarks

Tags
barbuttonitem, ipad, splitview, splitviewcontroller, toolbar

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: 362
16 members and 346 guests
Absentia, akphyo, apatsufas, BinHex, dre, fredidf, Gaz, gmarro, host number one, jeroenkeij, Kirkout, MarkC, mottdog, PavelMik, whitey99, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,667
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, host number one
Powered by vBadvanced CMPS v3.1.0

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