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-07-2011, 10:24 PM   #1 (permalink)
Registered Member
 
Join Date: Mar 2011
Posts: 76
ae262 is on a distinguished road
Default changing view controllers and memory release

Hi guys,

I have a very basic question - when I add a view controller as a subview, do I lose all the other instances and information on the parent view controller?

Here is my problem:

I am adding a view controller as a subview and this is performed by pressing a button. When I try to go back to the original view (controller) by removing this second view controller, I am getting an error saying message sent to a deallocated instance.

I am essentially trying to mimic NAV controller but without using those because I want to design where I want to have the back button etc.
ae262 is offline   Reply With Quote
Old 09-08-2011, 01:04 AM   #2 (permalink)
Registered Member
 
SundialSoft's Avatar
 
Join Date: Oct 2010
Location: Scotland
Posts: 176
SundialSoft is on a distinguished road
Default moving between view controllers

Can you post the code you use to show one of the sub view controllers and to remove it. You would not normally lose anything in the primary screen on which you have the buttons if you were doing it correctly.

Do you know what it is that's being sent a message after it's deallocated? Is it the sub view that's getting a message after you have exited back to the main screen perhaps? That would make more sense, perhaps a delegate that's not been set to nil.
SundialSoft is offline   Reply With Quote
Old 09-08-2011, 01:18 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2011
Posts: 6
phani is on a distinguished road
Default

Quote:
Originally Posted by ae262 View Post
Hi guys,

I have a very basic question - when I add a view controller as a subview, do I lose all the other instances and information on the parent view controller?

Here is my problem:

I am adding a view controller as a subview and this is performed by pressing a button. When I try to go back to the original view (controller) by removing this second view controller, I am getting an error saying message sent to a deallocated instance.

I am essentially trying to mimic NAV controller but without using those because I want to design where I want to have the back button etc.

may b u r releasing "view controller" after ur navigating into an other view...

post ur code,so that we can help u more...
phani is offline   Reply With Quote
Old 09-08-2011, 06:39 AM   #4 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

For start, having a navigation controller doesn't mean you must have a navigation bar. You can hide it, and implement your own controls. So I'd suggest you rethink your approach and not try to reinvent the wheel.

Other than that it's impossible to say what exactly is the problem without seeing detailed crash logs and/or code.
baja_yu is offline   Reply With Quote
Reply

Bookmarks

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: 383
8 members and 375 guests
apatsufas, JackReidy, jeroenkeij, Sami Gh, tim0504, UMAD, yomo710
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,671
Threads: 94,121
Posts: 402,904
Top Poster: BrianSlick (7,990)
Welcome to our newest member, JackReidy
Powered by vBadvanced CMPS v3.1.0

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