我正在尝试将 ClassB 设置NSString
为NSTextField
在 ClassA 中调用该方法的位置。但NSTextField
不是初始化 的值NSString
。
B类.h
NSString *folderPath;
B类.m
- (id)initWithWindow:(NSWindow *)window
{
self = [super initWithWindow:window];
if (self) {
[alertWindow setIsVisible:NO];
[pdfStatusText setStringValue:@"Null"];
}
return self;
}
-(id)initWithAlertWindowControllers:(NSString*)fileName andTitle:(NSString *)title
{
//some part of code here
//i am trying to set String value to the NSTextField pdfStatusText
folderPath=fileName;
[pdfStatusText setStringValue:folderPath];
}
- (void)windowDidLoad
{
[super windowDidLoad];
[self.window makeKeyAndOrderFront:self];
}
班A.m
_alertWindow = [[AlertWindowController alloc] initWithAlertWindowControllers:Path andTitle:@"Project"];
谢谢..