我想我只是在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