让我先说我是 Objective C 的新手。
我收到错误
atusMenuApp[24288:303] -[__NSCFConstantString createListItem]: unrecognized selector sent to instance 0x100002450
这是我的代码:
selector = [NSMutableArray arrayWithObjects: @"nvda", @"aapl", @"goog", nil];
[selector makeObjectsPerformSelector:@selector(createListItem:) withObject:self];
- (void)createListItem:(NSString *)title {
//do some stuff
}
现在我已经做了很多环顾四周,似乎这个问题的最大原因是增加或缺乏,:
但我相信我正确地拥有它。也许我不太了解它的用法,makeObjectsPerformSelector
因为在查阅了上面的文档后我发现:
Sends to each object in the array the message identified by a given selector, starting with the first object and continuing through the array to the last object.
任何帮助都会很棒,谢谢!