This is my first time using this place.
I am currently developing a game using xcode6 objective-c.
Memory release is not working.
After transitioning from viewcontroller A to viewcontroller B
I am using dispatchViewControllerAnimated in B.
Memory has not changed since returning to viewcontroller A.
Even if you removeFromSuperview everything you declared as an instance,
Only about 20 percent of the total was released.
after returning from B to A using the dismissViewControllerAnimated
If you transition from A to B again,
Bad_access will appear in various places with some variables remaining.
when using dismissViewControllerAnimated
Release all contents of viewcontroller B and
After transitioning from A to B again, I would like to read from 1
Can't you do something about it?
I may not be able to explain enough, but I appreciate your cooperation.
objective-c
There seems to be a misunderstanding about the timing of the View Controller's memory release, so let me check.
Modally displayed View Controllers are released from memory when dismissViewControllerAnimated:
is completed, or removeFromSuperview
will not be released.
To verify this, try writing the dealloc()
method in viewcontroller B.
-(void)dealloc{
NSLog(@"ViewController B instance was released.");
}
When you run dismissViewControllerAnimated:
with viewcontroller B as the receiver, the console immediately prints VViewController B instance was released. /
A common case is circulation reference when the modal display is terminated but the memory is not released as expected.If you search the Internet with keywords such as Objective-c ARC circular reference, you will be able to find information in Japanese about circular reference.Of course, if you're directly involved in Apple's official documentation, it's no better than that.
619 Uncaught (inpromise) Error on Electron: An object could not be cloned
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
582 PHP ssh2_scp_send fails to send files as intended
578 Understanding How to Configure Google API Key
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.