dealloc Questions

3

Solved

@interface someview:UIView{ NSTimer* timer; } @end @implementation someview -(void)dealloc{ NSLog(@"dealloc someview"); [timer invalidate]; timer = nil; } -(void)runTimer{ // } -(void)someMet...
Habiliment asked 14/4, 2011 at 22:25

3

Solved

How can i unregister the observer, when the observing object gets dealloced? How can cocoa bindings handle a situation when the observed objects gets deallocated? By using manual KVO, i have to r...
Jambalaya asked 20/11, 2013 at 16:34

1

I have a fairly simple UITableView that pushes a new view on the stack. The new view has a gestureRecognizer that is initizalied like this @synthesize swipeGestureLeft; - (void)viewDidLoad { ...
Alveta asked 13/9, 2013 at 1:1

4

Solved

I have a pretty basic question. In some examples I've seen, objects are just released in the dealloc method. In others, the objects are released and then set to nil. Is there a reason for this? Is ...
Volition asked 21/7, 2011 at 15:39

1

I'm trying to pass block arguments to a NSInvocation, but the app crashes. The invocation makes a network request and calls the success or failure blocks. I think the problem is that blocks are dea...
Karee asked 3/6, 2013 at 2:28

4

Solved

I am working with Automatic Reference Counting. I have a custom UIViewController subclass and whenever I call -presentViewController: animated:completion: or remove its view from the superview I w...

3

In Android I have singleton class but I am not sure if the garbage Collector can deallocate it. If garbage Collector will deallocate my singleton class how can avoid it from deallocation?
Consensual asked 2/3, 2013 at 16:6

2

I am relatively new to iOS development so appreciate your help in finding out the root cause for the error that I encountered. I tried to debug the error using Instruments (i.e. Allocations-Zombie...
Misreckon asked 6/12, 2012 at 7:54

1

Solved

I have a singleton class that accumulates data until that data is written to my database (if you want to know why I'm implementing things this way, see here). After saving the data, I would like to...
Messaline asked 27/10, 2012 at 21:17

7

Solved

sorry for this question, but I searched it and I didn't find an answer for that case. I'm studying memory management for iOS and I understood, or I think so, the view lifecycle. But now I have a q...
Hudis asked 14/2, 2012 at 17:18

2

Solved

While displaying a popover controller for a second time (after dismissing it and then re-displaying it), I get the following error: Terminating app due to uncaught exception 'NSGenericException', ...

4

Solved

Hello I have this question: I would like to have a vector as class member. This is perhaps my question easier for you and I apologize for that. how should I declare the vector? And is this correc...
Cruller asked 18/12, 2011 at 17:36

1

Solved

I have a EXC_BAD_ACCESS error. I used Profile in xCode 4 to see what is happening with memory and saw that it is zombie event: An Objective-C message was sent to a deallocated object(zombie) at ad...
Timothytimour asked 4/12, 2011 at 18:55

4

Solved

I have the following code to test memory deallocation using a std::list container: #include <iostream> #include <list> #include <string> #include <boost/bind.hpp> /* coun...
Positively asked 8/11, 2011 at 12:0

2

Solved

If my instance is observing some property of another object, am I supposed to call removeObserver:forKeyPath: in dealloc?
Bundesrat asked 19/10, 2011 at 19:4

2

Solved

I know that this is rarely required to override the alloc or dealloc methods,but if required is it possible in iPhone programming?
Egarton asked 29/9, 2011 at 11:28

3

Solved

I know memory management in iOS is tricky subject to newbies like me, but I was hoping for a clear explanation here on stackoverflow which I could not find anywhere else. So, pretend I have a pro...
Fanelli asked 3/9, 2011 at 13:13

1

In my little iPad app I have a "switch language" function that uses an observer. Every view controller registers itself with my observer during its viewDidLoad:. - (void)viewDidLoad { [super view...

1

Solved

I am doing this : UIImageView *backgroundImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mainback.jpg"]]; [self.view addSubview:backgroundImage]; NSLog(@" retain count1 : %d " , ...
Trenna asked 20/8, 2011 at 9:50

4

Solved

When a custom class is created in Objective C, when and how is the dealloc method called? Is it something that I have to implement somehow in my class?
Bolyard asked 17/8, 2011 at 12:53

4

Solved

I have a created a small app which uses location services on the iPhone. All works well, except the fact, that sometimes, the small arrow in the info-bar stays active even if I explicitly kill the ...
Patrilocal asked 2/2, 2011 at 8:6

1

Solved

In Objective-C, I understand that if an object sets itself as the delegate of another object, it should set that object's delegate to nil in its dealloc to avoid getting sent messages after it's go...
Mitsukomitt asked 25/5, 2011 at 0:29

1

Solved

Is it a bad idea to use the dot notation to initialize retain properties to nil in my init methods? With any ordinary property like this: @property (nonatomic, retain) id foo; Say in my init m...

2

Solved

I have a category on an existing class that adds a property and a few methods to the class. @interface AClass (ACategory) { NSString *aProperty; } @property (nonatomic, retain) NSString *aProper...
Nursery asked 6/12, 2010 at 19:53

1

I know declared property generates accessor method which is someway just syntax sugar. I found quite a lot people use self.property = nil in their dealloc method. 1) In Apple's Memory Management ...
Quail asked 11/4, 2011 at 12:18

© 2022 - 2024 — McMap. All rights reserved.