【发布时间】:2009-07-07 09:49:35
【问题描述】:
对于 NSMutableString,我如何在索引“0”处为名为“a”的 NSMutableString 插入一个“-”符号。现在我的代码如下所示:
a = [insertString: @"-" atIndex: 0];
Xcode 抛出一个错误,指出“insertString”未声明。我的代码看起来很不对劲。请给我指导。
【问题讨论】:
-
要扩展 @jop 所说的内容,它的
[receiver message (possibly arguments here, arguments are indicated by a : colon)]。在这种情况下,正确的格式是[a /*receiver*/ insertString: /*message*/ @"-" atIndex: 0 */arguments*/]
标签: iphone objective-c cocoa cocoa-touch