문제

I have a stupid problem, in my code I do:

in .h

@property (nonatomic, retain) UIImage *currentImage;

in.m

@syntesyze currentImage;

then in my class I use "self.currentImage"...

in dealloc I try to do:

[self.currentImage release] or self.currentImage = nil

but my app crash ever and the problem is that "message sent to deallocated instance", why? I have a retain in .h, what's the problem?

도움이 되었습니까?

해결책 2

I solved my problem with

self.currentImage = nil;

in viewDidUnload method.

다른 팁

remove self from self.currentImage.

[currentImage release];
currentImage = nil;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top