Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1113091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:48:14+00:00 2026-05-17T02:48:14+00:00

What are the differences and the implications of the differences between the boilerplate push

  • 0

What are the differences and the implications of the differences between the boilerplate push provided by apple

     <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
 NSManagedObject *selectedObject = [[self fetchedResultsController] objectAtIndexPath:indexPath];
 // ...
 // Pass the selected object to the new view controller.
 [self.navigationController pushViewController:detailViewController animated:YES];
 [detailViewController release];

and this method (from PragProg iphone SDK development Book) cabinet controller is added to interface and @synthesize in implementation:

  [self.navigationController pushViewController:self.cabinetController
                                       animated:YES];

i would chalk it up to the newness of the SDK i am working with versus the book…but that seems really different and seems to imply VERY different ownership, if that is the correct word. My main concern, if the question is too convoluted to answer, is whether or not one of these methods is more memory efficient.

EDIT:
ok, well, after clearing my vision by posting this question…i don’t think there that much of a difference. the boilerplate method allocates memory on demand where the books method makes the cabinet view a property. i think that makes the boilerplate method better somehow…or equal…that part i am still fuzzy on. it seems like both will release just the same but maybe the memory is held earlier using the books method.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:48:14+00:00Added an answer on May 17, 2026 at 2:48 am

    The Apple version is more memory efficient, because the detailViewController and it’s view will be deallocated when it gets popped from the navigation controller’s stack. Unlike the PragProg version, which retains the cabinetController in an instance variable (and therefore prevents it from being deallocated), the Apple code isn’t storing a reference to the detail controller it’s creating.

    The PragProg implementation might make sense if the user is likely to navigate frequently back and forth between the cabinet controller and the view controller that’s retaining it, since that avoids a bit of CPU overhead incurred by repeatedly creating and deallocating the objects, but you’d have to profile it to see if that makes any meaningful difference (which it ordinarily wouldn’t).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

assuming v is a nullable, I'm wondering what are the implications / differences between
What are the major differences between LLVM GCC 4.2 and Apple LLVM compiler 3.1?
What differences does exist between that two commands. NSLog(@Hello World!!); and LOG(@Hello World!!); NSLog
The differences between StringBuilder and StringBuffer in Java are well documented and have been
There are any differences between using SetValue with (for example) Canvas.LeftProperty and Margin Property?
What are the differences between preg_replace() and preg_filter() ? In which situations should I
What are the main differences between these WPF controls? And when I should use
Are there any differences between LEA $1000,A0 and MOVE #$1000,A0 to put an address
Are there any differences in functionality between these two JavaScript module patterns? var MODULE
I know the differences between IBAction and IBOutlet, but I don't know when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.