UIAlertView
をプログラムでキャンセルするにはどうすればよいですか? 。これは、私はこのようなdismissWithClickedButtonIndex:
を使用するUIAlertViewUIAlertViewをプログラムでキャンセルする
UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Save Background" message:@"Downloading..." delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil, nil];
CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0.0, 70.0);
[myAlertView setTransform:myTransform];
[myAlertView show];
私はそれを入力していたときよりも20秒速いです。["cancelButtonIndex'"](https://developer.apple.com/library/ios/documentation/UIKit/Reference/ UIAlertView_Class/UIAlertView/UIAlertView.html#// apple_ref/occ/instp/UIAlertView/cancelButtonIndex)は常に "-1'"になるとは限りません。 –