Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't seem to be able to re alloc a released UIView
    primarykey
    data
    text
    <p>I have a UIView which I create programmatically roughly like so:</p> <pre><code>@implementation SlideShowView - (id)initWithImages { … if (self=[super initWithFrame:CGRectMake(0, 0, 320, 480)]) { // init objects here } return self; } - (void)dealloc { printf("dealloc slide show view\n"); [[NSNotificationCenter defaultCenter] removeObserver:self name:@"unlockUI" object:nil ]; [[NSNotificationCenter defaultCenter] removeObserver:self name:@"setUserRating" object:nil ]; [mCurrentImageView release]; [mRightImageView release]; [mLeftImageView release]; [mImages release]; [queue cancelAllOperations]; [queue release]; [managingArray release]; [super dealloc]; } </code></pre> <p>with a uiview controller that contains this:</p> <pre><code>- (void)loadView { { ... self.view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; self.slideShowViewObject = [[SlideShowView alloc] initWithImages]; [self.view addSubview:slideShowViewObject]; … } -(void)dealloc { [slideShowViewObject release]; [self.slideShowViewObject removeFromSuperview]; printf("dealloc of slideshow view controller\n"); [super dealloc]; } </code></pre> <p>this seems to be able to dealloc both the view controller and view but when I push this view controller back onto the stack I get the message with zombie enabled: -[SlideShowView retain]: message sent to deallocated instance 0x43ab160</p> <p>should the alloc not be creating a new instance of the view when the controller is pushed? I don't understand and after spending many hours reading through other posts as well as looking at memory guides I would say I'm thoroughly stumped! Can someone offer any pointers? I only posted the code I deemed necessary but I can post more if need be. Thanks so much!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload