친구들. iphone을 처음 사용했습니다. 문제가 발생했습니다 .Uiimageview는 ... 코드를 공개 할 수 없습니다.아이폰 UIIMAGEVIEW는 출시 할 수 없습니까?
#import <UIKit/UIKit.h>
@interface imageNavView : UIImageView {
int index;
}
@property int index;
@end
#import "imageNavView.h"
@implementation imageNavView
@synthesize index;
- (id)initWithFrame:(CGRect)frameRect{
self = [super initWithFrame:frameRect];
if (self) {
// Custom initialization.
self.userInteractionEnabled=YES;
self.multipleTouchEnabled=YES;
self.opaque=YES;
self.autoresizingMask=(UIViewAutoresizingFlexibleHeight|
UIViewAutoresizingFlexibleWidth|
UIViewAutoresizingFlexibleRightMargin
|UIViewAutoresizingFlexibleLeftMargin
|UIViewAutoresizingFlexibleTopMargin
|UIViewAutoresizingFlexibleBottomMargin);
index=0;
}
return self;
}
- (void)dealloc {
NSLog(@"before image dealloc %i",[self retainCount]);-------- log is 1
[super dealloc];
NSLog(@"after image dealloc %i",[self retainCount]);-------- log is 1,why itn't bad access?
}
@end
이유는 두 번째 ([자기 retainCount] "이미지 할당 해제의 %의 난 후에"@) NSLog 로그 않는다; 1이면 잘못된 액세스가 아니므로 이미지 뷰가 해제되지 않습니다. 나는 이해할 수 없다, 어떤 가능한 방법이라도 이것이 일어날 수 있는가? ... 조언은 감사 할 것이다.
에 유지 수를 감소하는 객체 해제에 대한 이유가 없다. –