Questions tagged [dealloc]

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.

496 questions
0
votes
1 answer

Early dealloc call over-releasing object iOS

My app is crashing due to an over-released object and I have narrowed it down to the early call of dealloc in a custom class. This causes a crash attributed to an NSMutableArray that is using the custom class listed below: #import…
Jace
  • 145
  • 2
  • 11
0
votes
2 answers

UIViewcontroller with multiple views

The project currently has a UIviewController called "Dashboard" that acts as the main view of all the application. This main view consists of two subviews on top of it, kind of like a splitview. The left side of the main (left view) has multiple…
Angie
  • 433
  • 1
  • 6
  • 19
0
votes
6 answers

Is it necessary to release this object in dealloc?

I have a question. In my .h: NSString *string; @property(nonatomic, retain)NSString *string; In my .m: string=[NSString stringWithFormat:@"%@", otherStringWithValue]; Ok, "stringWithFormat" is an autorelease method. Need I release "string" in…
Alberto Juarez
  • 448
  • 8
  • 22
0
votes
1 answer

Why is class dealloc not called when expected using ARC?

I have a UIView subclass, and within this I call this other UIView subclass. Stars.h @interface Stars : UIView { BOOL _gained; } @property (nonatomic, weak) id delegate; @property (nonatomic) BOOL…
Darren
  • 9,325
  • 19
  • 83
  • 140
0
votes
2 answers

Variable suddenly removed

I know the title may sound a little weird, but the same goes for the problem. I've been testing my app on the simulator almost the entire time in development, I did test it once in a while on a real device just to make sure. But now that I'm close…
woutr_be
  • 8,913
  • 22
  • 70
  • 121
0
votes
2 answers

release managedObjectContext object c

I have tried to use the Analyze instrument to see the memory leaks, and Xcode gives me a memory leak in this point: .h @property (strong, nonatomic) NSManagedObjectContext *managedObjectContext; .m @synthesize managedObjectContext =…
Piero
  • 8,533
  • 18
  • 82
  • 153
0
votes
2 answers

dealloc in NSOperation

i have a NSOperationQueue with NSOperation, in my NSOperation .h i have this property: @interface MyOperationClass : NSOperation @property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController; @property (strong, nonatomic)…
Piero
  • 8,533
  • 18
  • 82
  • 153
0
votes
1 answer

reference to view property is retaining the view controller

I am having memory leaks when I m using a view controller's view My code sequence is like this viewController1 = [[ViewController alloc] init]; destinationViewController = [[DestinationViewController alloc] init]; [destinationViewCOntroller…
sridevi
  • 617
  • 1
  • 6
  • 15
0
votes
1 answer

Dismissing Keyboard and dealloc()

Got one here which is causing 'concern'... I have a modal view controller which uses the keyboard. I am using a system to dismiss the keyboard from code on stackoverflow which appear to be the 'new way' of recognising taps outside the keyboard to…
Fittoburst
  • 2,105
  • 1
  • 18
  • 31
0
votes
1 answer

Not calling [super dealloc] inside a static UIViewController subclass

In my app I have a UIViewController subclass (VC for short) that I only use in one place in the entire app. In that place, I have been creating and pushing it like this: MyViewController* VC = [MyViewController new]; [self.navigationController…
eric.mitchell
  • 8,501
  • 12
  • 50
  • 91
0
votes
1 answer

Cocos2d not dealloc-ing the scene (again)

this is my first post so don't go too rough on me. I have a problem with cocos2d. Im making a game with a HUD layer and a game layer. When I call replace main menu scene with [ClassicGameLayer scene] my HUD and game layer get init-ed this way: +…
Majster
  • 3,260
  • 4
  • 33
  • 58
0
votes
2 answers

IOS dealloc never gets called

I have a navigation-based app that switches between some ViewControllers. If I press the "goHome" button, the method popViewControllerAnimated: is called and I return to the main screen. There is a problem though : the dealloc method doesn't get…
Teo
  • 3,246
  • 9
  • 37
  • 70
-1
votes
1 answer

Instance of my own UIViewController subclass is not getting deallocced when pressing back

So, I got a little problem with my own UIViewcontroller subclass, it won't get deallocced when I press the back button on the navigation bar. I really have no idea why it won't even call the dealloc method. My other viewcontroller deallocs just…
Samuli Lehtonen
  • 3,780
  • 4
  • 36
  • 45
-1
votes
2 answers

Dealloc objects of another class

Hi I generally create objects of another classes. can you please tel me if this wil be in the auto release pool? or should we release it manually.
rakendu
  • 21
  • 4
-1
votes
1 answer

deallocate of allocator in C++

I've defined a class template Vec which holds a sequence of T like vector: template class Vec { public: size_t size() const { return first_free - elements; } size_t capacity() const { return cap - elements; } …
Vogel_guo
  • 51
  • 8