Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
Value passing problem from once class to another
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Nethfel" data-source="post: 1290964" data-attributes="member: 89124"><p>Well, where's the code that actually pushes the sub table view controller? How are you referencing it from the app delegate? I see your base instantiation, but from the scope, it will only exist in the method:</p><p></p><p>[code]</p><p> - (void)applicationDidFinishLaunching:(UIApplication *)application</p><p></p><p>[/code]</p><p> - no where do you pass the sub view controller to your root view.</p><p></p><p>Usually when using a nav controller, when you need to push a new view, it's instantiated and has its ivars set just before pushing onto the view controller, not at the point of the app delegate. The only view controller that should be instantiated at the app delegate at launch is the root view controller and any controllers the root view controller requires to operate (ie: navigation view controller as the root, and then its initial view controller) - there are only rare times where you'd need more then those required view controllers (like if you're outputting to an external screen through your app).</p><p></p><p>Unfortunately, there isn't enough code shown to fully see how you are pushing your sub view onto the stack and how you think you're accessing it, which would seem at this point you're not accessing at all (btw - with what you've shown, you leak that view controller)...</p></blockquote><p></p>
[QUOTE="Nethfel, post: 1290964, member: 89124"] Well, where's the code that actually pushes the sub table view controller? How are you referencing it from the app delegate? I see your base instantiation, but from the scope, it will only exist in the method: [code] - (void)applicationDidFinishLaunching:(UIApplication *)application [/code] - no where do you pass the sub view controller to your root view. Usually when using a nav controller, when you need to push a new view, it's instantiated and has its ivars set just before pushing onto the view controller, not at the point of the app delegate. The only view controller that should be instantiated at the app delegate at launch is the root view controller and any controllers the root view controller requires to operate (ie: navigation view controller as the root, and then its initial view controller) - there are only rare times where you'd need more then those required view controllers (like if you're outputting to an external screen through your app). Unfortunately, there isn't enough code shown to fully see how you are pushing your sub view onto the stack and how you think you're accessing it, which would seem at this point you're not accessing at all (btw - with what you've shown, you leak that view controller)... [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
Value passing problem from once class to another
Top