アプリケーションでNSStringに問題があります。基本的に、値「602」を含むo1stringというNSStringがあります。これを他のテキストと一緒にUIAlertViewに出力したいと思います。
votedmessage = [ NSString stringWithFormat:@"The current standings are as follows:\n\n%@: %@ votes", b1title, o1string ];
UIAlertView *votedAlert = [[UIAlertView alloc] initWithTitle:@"Thank you for voting" message:votedmessage delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
NSLogを使用して、NSString内の値が確実に602であり、メッセージで使用される他の変数(b1title)がそれ自体で正常に出力されることを確認しました。アラートメッセージにo1votes変数を追加すると、アプリがクラッシュする理由を理解できませんが、NSString内に数字だけを保持する際の競合と関係がありますか?
これがo1stringの設定方法です。XMLファイルから取得した「602」が確実に含まれています。
o1string = [[options objectAtIndex:3] objectForKey: @"votes"];
o1string = [o1string stringByReplacingOccurrencesOfString:@"\n" withString:@""];
o1string = [o1string stringByReplacingOccurrencesOfString:@" " withString:@""];