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
Dealloc gives warnings
I am practicing making a simple app that switches scenes with a scene controller (state manager) class.
I created my scene:
+(CCScene *) scene
{
CCScene *scene = [CCScene node];
GameMenu *layer = [GameMenu node];
[scene addChild:…

HelloWorld
- 181
- 2
- 3
- 10
0
votes
1 answer
Memory issue in iPhone app
Please help, I am really struggling with the memory leak issue. Here is my code
+ (void) getInitialDataToDisplay:(NSString *)dbPath {
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
…

Mithuzz
- 1,091
- 14
- 43
0
votes
2 answers
Objective-C Property assignment without @property
I'm currently developing an iOS application which was started by another developer.
Usually, I make a property for every instance variable (assign for int, bool etc. / retain for all classes).
So in my projects, this line causes a leak:
myVar =…
0
votes
4 answers
Request traitement crash - Message sent to deallocated instance
I'm executing an asynchronous method on an object and when my request is finish I print the result in a label. My problem is : if I launch my request and then I remove my object, I have a crash on my setText method (because my object is…

Pierre
- 10,593
- 5
- 50
- 80
0
votes
2 answers
UIViewController not calling dealloc or calling it twice
I have some problem with my singleton and UIViewController there;
Singleton.h
@property (nonatomic, retain) UIViewController *viewController;
Singleton.m
...
@synthesize viewController = _viewController;
- (void)load {
self.viewController =…

Rost K.
- 262
- 2
- 14
0
votes
2 answers
UIViewcontroller never deallocated
I came here to ask for help because I'm on my way to finishing my iphone project and I want it to be perfect!
I have some issues with allocation and deallocation of a UIViewcontroller.
Let me explain :
I have a UITableview with custom cells. In each…

Pwyll28
- 3
- 4
0
votes
2 answers
AVAudioRecorder does not stay retained
I am using AVAudioRecorder in my mac app. In my .m file I declare
@interface RecordViewController ()
{
AVAudioRecorder *audioRecorder;
...
}
@end
further down I then alloc init the object like so:
audioRecorder = [[[AVAudioRecorder alloc]…

Joseph
- 9,171
- 8
- 41
- 67
0
votes
2 answers
didReceiveMemoryWarning Crash
-Using ARC
-I have 5 separate view controllers all subclassing a class I made called "UIViewControllerWithLoadingView" which subclasses UIViewController.
-In both the subclasses and superclass I allocate and deallocate properties like…

MobileMon
- 8,341
- 5
- 56
- 75
0
votes
2 answers
Why does setting self.object to nil cause a crash
In the following scenario I get a crash
if (self.videoEngine != nil)
{
[self.videoEngine.player.view removeFromSuperview];
[videoEngine release];
self.videoEngine = nil;
}
The videoEngine object is (nonatomic, retain), and it is…

Elliott D'Alvarez
- 1,217
- 16
- 30
0
votes
1 answer
Notification when an object is released by ARC System
I am converting my Huge project to ARC, though success fully converted and I am using it but there are some lines of code still there in dealloc which needs to be called anyway.
Example I was stopping and releasing the MPMoviePlayerController…

infiniteLoop
- 2,135
- 1
- 25
- 29
0
votes
2 answers
dealloc is being called and I am not sure why
I have a view with some buttons, text fields, and methods. When I load the view, switch to another view, and then switch back, my app crashes. I added in an NSLog in each method to see what the last method call before the crash was, and it was…

BloonsTowerDefence
- 1,184
- 2
- 18
- 43
0
votes
2 answers
Delayed deallocation of contained objects with ARC?
I recently migrated my game to ARC.
First, I noticed my app crashed after playing for a while. So I began debugging it and noticed that, on receiving a memory warning, the deallocation of some resources was being corrupted.
Background (Don't read if…

Nicolas Miari
- 16,006
- 8
- 81
- 189
0
votes
2 answers
memory issue when passing the cclayer to my objects
I've got a CCLayer where I want to add many buttons.
I created the class MyButton with this init function:
-(id) initWithLayer:(MyLayer *)theLayer andDictionary:(NSDictionary *)data {
self = [super init];
if (self != nil)
{
self.layer =…

nano
- 2,511
- 4
- 25
- 42
0
votes
1 answer
Issue in UIViewController push & pop
I've facing an issue of push & pop my UIViewController. I've two UIViewControllers say A & B.
I have written an IBAction in which I pushing to B from A like,
B *bView=[[B alloc] initWithNibName:@"B" bundle:nil];
[UIView beginAnimations:@"animation"…

Hemang
- 26,840
- 19
- 119
- 186
0
votes
1 answer
when ViewDidUnload and Dealloc method is called in UIVIew Controller?
I have read many answers regarding this still i am getting confused if i want to check using simulator Is there Any way to identify which methods called at which time? some one is saying dealloc () method is calling when you view controller is…

Ankit Vyas
- 7,507
- 13
- 56
- 89