尝试应用修补程序并编译接收到的警告消息:
<some_file>: In function '-[XXXXX saveAndCreate:]':
<some_file>:262: warning: 'NSString' may not respond to '-stringByReplacingOccurrencesOfString:withString:'
<some_file>:262: warning: (Messages without a matching method signature
<some_file>:262: warning: will be assumed to return 'id' and accept
<some_file>:262: warning: '...' as arguments.)
distcc[6493] ERROR: compile (null) on localhost failed抱怨这段代码,
[clientHost findAvailableIn:
[clientHost defaultVMPath]
baseName:
[displayName stringByAppendingPathExtension:PL_BUNDLE_EXTENSION]
nameFormat:[[displayName
stringByReplacingOccurrencesOfString:@"%"
withString:@"%%"]
stringByAppendingString:@" %u.xxxx"]
startIndex:2
contextInfo:contextInfo];下面是编译命令的一部分:
lin32/gcc-5363-1/bin/i686-apple-darwin8-gcc -mmacosx-version-min=10.4 -arch i386 -march=pentium-m -mtune=prescott -Werror -Wall -Wno-trigraphs -Wreturn-type -Wunused-variable -pipe -O2 -g3 -gfull -Wno-pointer-sign -x objective-c -fobjc-exceptions -fpascal-strings -fmessage-length=0 谷歌搜索了警告,并尝试了这里方法,但仍然得到了同样的警告信息。
我对Mac的开发一无所知,如果这是显而易见的事情,请原谅我(我不知道上面所提供的信息是否是多余的,请告诉我还需要提供什么)。谢谢。
编辑:1)扩展代码块。2)纠正警告信息。
发布于 2010-02-10 15:53:01
你是在进口<Foundation/Foundation.h>吗?令人惊讶的是,您会收到此警告,但在-stringByAppendingPathExtension上却没有收到警告。这真的是你唯一收到的警告吗?
我建议拆分代码以创建一些临时变量。您正在执行如此多的嵌套方法调用,因此很难确定您的错误在哪里。编译器将优化出大多数临时变量,因此当代码变得更清晰时,没有理由避免这些变量。
https://stackoverflow.com/questions/2237573
复制相似问题