Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem is that you're creating the view controller, but you're not using it, but rather only using its view (but letting ARC release the view controller, itself, when it goes out of scope). When transitioning between view controllers, you should use pushViewController (if you're using a navigation controller) or presentModalViewController (if you want to present the next view modally; in iOS 5 use presentViewController). In the unlikely event you are using a container view controller, you could even use transitionFromViewController to transition between child view controllers. See <a href="http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html" rel="nofollow">View Controller Programming Guide</a> for guidance on how to transition between view controllers. But in WWDC 2011 session 102, Apple clearly advises that you want to ensure that your hierarchy of view controllers be properly structured (generally mirroring your view hierarchy); you shouldn't be just adding views and ignore the view controller hierarchy.</p> <p>Anyway, the standard technique for transitioning between views is to use a navigation controller (that's what gives you the title bar with the "back" button ... you can hide it if you don't want it visible):</p> <pre><code>record_audio_testViewController *view2 = [[record_audio_testViewController alloc] initWithNibName:@"record_audio_testViewController" bundle:nil]; [self.navigationController pushViewController:view2 animated:YES]; // if non-ARC project, uncomment the following line // [view2 release]; </code></pre> <p>Finally, if you really want to use your technique of adding the view of your new controller as a subview of your current view controller's view (which doesn't seem like a good idea), you just want to make sure that ARC doesn't release it when it goes out of scope. So, don't let it go out of scope by making the new view controller an ivar of your current view controller, not a local var of your current method. That solves the ARC issue, but doesn't seem like a good technique, as you probably should be doing a proper transition between view controllers, but I present it in the interest of full disclosure.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload