【发布时间】:2012-01-02 15:24:53
【问题描述】:
我在 xCode 中进行了“构建和分析”并获得了“空指针的取消引用”。我在下面的代码中指出了我收到消息的行。我正在为 iPhone 开发。
“PDFScrollView.h”
#import "ENsightAppDelegate.h"
@interface PDFScrollView : UIScrollView <UIScrollViewDelegate> {
ENsightAppDelegate *appDelegate;
}
@end
“PDFScrollView.m”
- (id)initWithFrame:(CGRect)frame
{
if ((self = [super initWithFrame:frame])) {
// Set up the UIScrollView
self.showsVerticalScrollIndicator = NO;
self.showsHorizontalScrollIndicator = NO;
self.bouncesZoom = YES;
//self.decelerationRate = UIScrollViewDecelerationRateFast;
self.delegate = self;
[self setBackgroundColor:[UIColor grayColor]];
self.maximumZoomScale = 5;//200
self.minimumZoomScale = 0.5;//.85
self.userInteractionEnabled = YES;
self.delaysContentTouches = YES;
self.canCancelContentTouches = NO;
}
appDelegate =(ENsightAppDelegate *) [[UIApplication sharedApplication] delegate];
pdfView=[appDelegate GetLeaveView];
[self addSubview:pdfView];
return self;
}
不是完整的代码,贴上我觉得有用的。
我觉得这很奇怪。我怎么会收到这条消息?
【问题讨论】:
标签: iphone objective-c debugging code-analysis