我只是在了解目标 c 的基础知识。我想创建一个文本字段,其字符串与我选择的 Dropbox 单元格的标题相同。我有:
- (IBAction)dropbox:(id)sender{
NSPopUpButtonCell *sampleCell = [sender selectedCell];
[self setWord:@"%@",sampleCell.title];
[sampleCell release];
}
word 被声明为
@property (readwrite, nonatomic, retain) IBOutlet NSTextField *word;
@synthesize word = _word;
显然我在使用 [self setWord:] 时不允许使用占位符参数。你能为我指出正确的方向吗?