嘗試應用補丁和彙編收到警告消息:這是什麼錯誤消息抱怨?以及如何解決它?
<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
使用google搜索警告並嘗試了方法here,但仍收到警告消息。
我對Mac的發展一無所知,如果這是明顯的東西(我不知道上面提供的信息是否足夠,讓我知道還有什麼需要提供)。感謝名單。
編輯: 1)擴展代碼塊。 2)更正警告信息。
你能否澄清你的編輯? – FelixLam
我擴展了代碼塊,以便它可能會更清楚您的答案中不變的接收器是什麼。 –
你能否通過創建新變量來更好地分離問題,並嘗試將代碼格式化爲在SO中可讀? – FelixLam