別のviewControllerに切り替えたい。ビューにUIButtonがあり、次のコードを使用してUIButtonにUILongPressGestureRecognizerがあります。
UILongPressGestureRecognizer *buttonLongPressRecognizer;
buttonLongPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(LoadButtonSettings:)];
buttonLongPressRecognizer.numberOfTouchesRequired = 1;
buttonLongPressRecognizer.minimumPressDuration = 2.0;
[NewButton addGestureRecognizer:buttonLongPressRecognizer];
viewControllersを切り替えるために使用するアクションは次のとおりです。
- (IBAction)LoadButtonSettings:(id)sender {
[ButtonSettingsViewController setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self presentViewController:ButtonSettingsViewController animated:YES completion:NULL];
}
問題は、ボタンを長押しするとアプリがクラッシュし、SIGABRTエラーが発生することです。奇妙なことに、それは私のiPhoneでのみ発生し、シミュレータでは発生しません。
私も使ってみました
[self presentModalViewController:ButtonSettingsViewController animated:YES];
同じ問題が発生しました。私が知っているように、SIGABRTはメモリの問題があることを意味しますが、自動参照カウンターがオンになっているためわかりません。
これを修正する方法について何かアイデアはありますか?
前もって感謝します :)