我真的被這一個puzzeled。我在我的應用程序中設置了兩個UIActionSheets。它們工作得很好,直到使用UIActionSheets中的取消按鈕。UIActionSheet取消按鈕不斷崩潰我的應用程序
當我離開頁面UIAactionSheet返回時,它崩潰了我的應用程序。
有沒有人有任何想法?
-(IBAction) phoneButtonClicked:(id)sender
{
// open a dialog with just an OK button
phoneActionSheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:self cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:[NSString stringWithFormat:@"Phone: %@",phone],nil];
phoneActionSheet.actionSheetStyle = UIActionSheetStyleDefault;
[phoneActionSheet showInView:self.view]; // show from our table view (pops up in the middle of the table)
[phoneActionSheet release];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (actionSheet == phoneActionSheet) {
if(buttonIndex == 0){
NSString *callPhone = [NSString stringWithFormat:@"tel:%@",phone];
NSLog(@"Calling: %@", callPhone);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];
}
}
}
當應用程序崩潰時,是否有任何東西會記錄到控制檯?如果是這樣,發佈消息將有所幫助。 – jlehr 2010-05-12 14:42:23