如何在按下取消按鈕時使用UIActionSheet切換視圖?如何使用UIActionSheet切換視圖?
的Xcode 4.3.2
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
NSString *buttonTitle = [actionSheet buttonTitleAtIndex:buttonIndex];
if ([buttonTitle isEqualToString:@"Done"]) {
thiredViewController *controller1 = [[thiredViewController alloc] initWithNibName:@"thiredViewController" bundle:nil];
[self presentModalViewController:controller1 animated:NO];
}
}
這段代碼什麼也不做,認爲並沒有改變,我的朋友告訴我,我不能用這種方法來改變,在新的Xcode的看法,所以我應該我用 ?
- (無效)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger的)buttonIndex { 的NSString *按鈕名稱= [actionSheet buttonTitleAtIndex :buttonIndex]; if([buttonTitle isEqualToString:@「Done」])thiredViewController * controller1 = [[thiredViewController alloc] initWithNibName:@「thiredViewController」bundle:nil]; [self presentModalViewController:controller1 animated:NO]; }} – fatimah
這是我的代碼 – fatimah
我將你的代碼添加到你的問題並正確格式化。如果你想回答你的問題,請花些時間讓讀者方便一些,否則可能沒有人會打擾。 – Stefan