In Cocoa (and other frameworks that derive from NeXTSTEP), dealloc is the instance method responsible for tearing down an object. It should release the object's references to its ivars and then call up to the superclass's implementation.
Questions tagged [dealloc]
497 questions
0
votes
1 answer
Should I release simple NSString in dealloc
I have in .h:
@property (nonatomic,retain) NSString *myString;
In .m:
@synthesize myString;
myString =@"Test";
Do I have to release it in dealloc?
Because sometimes my app crashes due to [myString release], not sure why?

Houranis
- 361
- 2
- 4
- 16
0
votes
5 answers
Trouble Finding a Memory Leak
Hey everyone, i am having trouble finding a memory leak. all off my retain counts = 0 when i dealloc them but still I am flagging up a leak from the following bit of code:
- (GKSession *) peerPickerController:(GKPeerPickerController *)picker…

Adam Libonatti-Roche
- 321
- 1
- 3
- 14
0
votes
2 answers
nsobject dealloc never called
I create an object in each iteration of a for loop. However the dealloc function is never called. Is it not supposed to be released at each iteration? I am using ARC and I have NSZombies deactivated. I don not see either any circular reference.…

kahlo
- 2,314
- 3
- 28
- 37
0
votes
2 answers
iPhone - Multiple UIViewControllers Release
My main UIViewController, (PMGameViewController.h), is the file which my apps delegate calls.
There are several buttons on my main UIViewController (PMGameViewController.m). When a button is pressed I do an insertSuvbiew and attach another…

bbullis21
- 741
- 3
- 9
- 21
0
votes
2 answers
Memory not releasing when calling dealloc on NSFetchedResultsController
I am trying to debug a memory leak within my code (2.5mb) and it seems to be pointing to _prepareResultsFromResultSet within NSFetchedResultsController. I have 2 viewControllers (A & B), viewController B is pushed on to the navigationController from…

Elliott D'Alvarez
- 1,217
- 16
- 30
0
votes
0 answers
How to access CoreData Entities in different ViewControllers? The pointer seems to be retained upon dealloc
I am currently trying to figure out the best way to access entities in different UIViewControllers. I am currently using the following which seems to have the least live bytes:
View Controller 1 calls this when it wants to present the next…

Elliott D'Alvarez
- 1,217
- 16
- 30
0
votes
2 answers
Inheritance release order?
In my current test I have a class "PlanetClass" that inherits from "celestialClass". My question is when I release my "PlanetClass" object it goes through both dealloc methods, firstly releasing the Planet object and then the Celestial object. I…

fuzzygoat
- 26,573
- 48
- 165
- 294
0
votes
1 answer
Rogue Zombie on dealloc of ViewController
In Xcode, start a new master-detail project. Call it 'Test'.
Add a new 'File' to it. Make it a UIViewController file with XIB. Call it TestViewController.
Modify your MasterViewController code in the insertNewObject: method to say…

Fittoburst
- 2,215
- 2
- 21
- 33
0
votes
3 answers
UIViewControllers And ARC
So after much deliberation and a bit of frustration at spending time trying to search for memory management issues i did some research and finally succumbed to changing to ARC. And it was relatively painless. However a new issue has surfaced to do…

Genhain
- 1,937
- 1
- 19
- 38
0
votes
0 answers
Delalloc Call before DidFinishLoading in AppDelegate Class
In my application when I run it with xcode 4.2 it working perfectly but when I run it with xcode 4.5 then I find a critical error there. I found that Dealloc method of ApplicationDelegate call First, even it call before DidFinishLaunching and then…

iDhaval
- 7,824
- 2
- 21
- 30
0
votes
1 answer
Iphone: Does a custom made UIView needs a dealloc
I have a custom made uiview class, and i have a dealloc with other releasing call within it.
In this custom uiview, I have 3 outlet of controls : buttons, textview etc. When the custom uiview deallocated, I received this error: Error for object…

LittleFunny
- 8,155
- 15
- 87
- 198
0
votes
2 answers
how to properly alloc/dealloc this pointer? objective-c
*beginner iOS programmer, please explain with patience
suppose i have 2 classes - Foo, Bar
in class Bar, i have a pointer to an instance of Foo, which i set during init. (and because i dont know how to properly import Foo and Bar with each other, i…

David T.
- 22,301
- 23
- 71
- 123
0
votes
1 answer
Automatic Reference Counting (ARC). Can ARC handle free-ing a plain ole c-array?
I am getting up to speed on using ARC for my iOS app development. Occasionally a plain ole c-array of plain old c-structs is all I need to get the job done. Prior to ARC I would just add free() to my dealloc method. With ARC there is nolonger any…

dugla
- 12,774
- 26
- 88
- 136
0
votes
4 answers
How to see an object that is receiving messages after being deallocated
I am getting below error, but want more specific information like line number, class_name, method_name etc.
-[__NSArrayM release]: message sent to deallocated instance 0x72ab440
In other words, decrypt memory address 0x72ab440?
Any help?

swati sharma
- 367
- 4
- 15
0
votes
1 answer
memory keep on increasing when a opening a same uiviewcontroller again in iphone
I have two uiviewcontroller and i am releasing all the resources in dealloc and setting them to nil in didunload but still when i came across to both viewcontrollers the memory keep on increasing.
I am keeping the track of memory used and free…

Arun jalota
- 252
- 2
- 14