我在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;
}
这不是完整的代码,粘贴什么,我认为是非常有用的。
我觉得这很奇怪。我怎么得到这个消息?
谢谢您的回答。它的第一次尝试工作 – 2012-01-02 07:24:50