これを IOS 8 で実行すると、NSRangeException 例外が発生します。
UIActionSheet *uias = [[UIActionSheet alloc] initWithTitle:@"Test"
delegate:self
cancelButtonTitle:@"Test"
destructiveButtonTitle:@"Test"
otherButtonTitles:@"Test", nil];
[uias showInView:self.view];
出力からの例外:
2014-09-26 22:18:17.106 rcherzios[354:51170] * キャッチされない例外 'NSRangeException' が原因でアプリを終了します。理由: '* -[__NSArrayM replaceObjectAtIndex:withObject:]: インデックス 0 が空の配列の境界を超えています' *最初throw call stack: (0x2b153f87 0x38bc6c77 0x2b071331 0x10b587 0x2b96109b 0x2b961211 0x2b965897 0x2b963141 0x2b963579 0x2b964391 0x2b964215 0x2b966e2d 0x2b9641ab 0x2b99e65b 0x2b99d067 0x2b99ca87 0x2b9643e7 0x2b964215 0x2b966e2d 0x2b9641ab 0x2b99bd01 0x2b966e2d 0x2b99bc79 0x2b953bed 0x2b953ceb 0x2b11a82d 0x2b119af1 0x2b11864b 0x2b065db1 0x2b0af6cb 0x2b966b7f 0x392a6e67 0x392a6ddb 0x392a4b84) libc++abi.dylib: terminating with uncaughtタイプ NSException の例外 Signal: 6 (signal SIGABRT)
IOS7 およびシミュレーター IOS 8 でもすべてが機能しますが、IOS8 の実際のデバイスでクラッシュします...
私の複雑なアプリケーションでは、3年間働いていたように見えますが、すべての UIAlertView が同じ例外でクラッシュしています。新しい UIAlertController をテストしようとしたところ、同じ例外が発生しました。したがって、私の結論は、アプリケーションの一部の構成が UIAlertController に問題を引き起こしているということです。これは、実際に UIAlertView と UIActionSheet が ios 8 で使用しているものです。