stringByReplacingOccurrencesOfStringを使用して文字列を別の文字列に置き換えようとしていますが、何らかの理由で次のエラーが発生します。
-[__ NSCFNumber length]:認識されないセレクターがインスタンス0x6e49ef0に送信されました2012-05-14 16:30:49.741 coop [78129:f803] *キャッチされない例外'NSInvalidArgumentException'によるアプリの終了、理由:'-[__ NSCFNumber length]:認識されないセレクターインスタンス0x6e49ef0'に送信されました
NSString *_currentGroup;
NSString *location = [current objectForKey:@"location"];
if(_currentGroup != nil)
{
NSLog(@"_currentGroup: %@", _currentGroup);
// OUTPUT: _currentGroup: 92
location = [location stringByReplacingOccurrencesOfString:@"%group_id%" withString:_currentGroup];
}
私が次のことを試してみると、それはうまくいきます
location = [location stringByReplacingOccurrencesOfString:@ "%group_id%" withString:@ "anyOtherString"];
私はまだ何かが足りないのですか?