我见过与此类似的其他问题,但无法使用任何解决方案。
。H
@property (assign) IBOutlet NSTextView *commandOutput;
.m
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
Command *aCommand = [[Command alloc] init];
[self setCommand:aCommand];
if (self.commandOutput) NSLog(@"textView is not nil");
[self.commandOutput setString:@""];
}
我得到的错误信息是:-[NSScrollView setString:]: unrecognized selector sent to instance 0x100608630
我还看到:textView is not nil