开发者

Why isn't this instance variable being recognized?

开发者 https://www.devze.com 2023-04-01 08:45 出处:网络
In my .h: @class PanelController; @interface PanelController : NSWindowController <NSWindowDelegate>

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

精彩评论

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

关注公众号