解析问题:未找到模块'stringByAppendingFormat'

时间:2013-09-26 04:55:02

标签: objective-c ios7 xcode5

使用Xcode 5编写iOs7项目

我有以下简单代码

NSString* inflation=@"test'", *import=@"";
if ([inflation length]>0){
    import=[import stringByAppendingFormat:@"\nExports %@",inflation];
}

当我尝试编译时,我不断收到此错误: 未找到模块'stringByAppendingFormat'

enter image description here

2 个答案:

答案 0 :(得分:6)

LLVM使用import导入模块(目前是一个实验性功能,但似乎在Xcode中默认启用)。看看the docs

要解决您的问题,只需重命名该变量,或使用“-fno-modules”进行编译。

答案 1 :(得分:1)

此代码没有问题,所以不要怪ios7:P

只需更改您的变量名称。

NSString* inflation=@"test'", *importString=@"";
if ([inflation length]>0){
    importString=[importString stringByAppendingFormat:@"\nExports %@",inflation];
}
相关问题