我想我只是在iOS 4.3文档中找到一个不准确的地方,更具体地说在NSString
的页面上。NSString文档是否过时/错误?
我试图使用stringByReplacingOccurrencesOfString:withString:
方法,它是clearly in the documentation。
错误的文本(因为它是一个有点小):
然而,当我试图使用一只股票NSString
初始化这种方法,我用一个漂亮的错误迎接
'NSString' may not respond to '-replaceOccurrencesOfString:withString:'
warning: Semantic Issue: Method '-replaceOccurrencesOfString:withString:' not found (return type defaults to 'id')
出现上述错误的位置:
if ([elementName isEqualToString:@"name"]) {
NSString *temp = [[NSString alloc] initWithFormat:@"%@", currentString];
NSString *newTemp = [temp replaceOccurrencesOfString:@"\n" withString:@""]; // the error occurs here
[self.group.names addObject:temp];
}
所以,问题是,是我的错还是文档错了?
d'oh ........... – esqew 2011-06-02 02:13:48