开发者

Why isn't this instance variable being recognized?

In my .h:

@class PanelController;

@interface PanelController : NSWindowController <NSWindowDelegate>
{
    NSURL *zURL;
}

@property (nonatomic, assign) NSURL *zURL;

@end

In my .m:

@synthesize zURL;

...

- (IBAction)openBrowser:(id)sender {
    self.zUrl = [zOpenPanel URL];
}

Error:

zURL not found 开发者_如何转开发on object PanelController 


Because Objective-C is case sensitive.

You use self.zUrl but it should be self.zURL.

(Also, the instance variable declaration might be unnecessary if you declare a property.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜