현재 프로젝트에서 두 개의 UIAction 시트를 사용하고 있습니다. 완벽하게 작동하도록 하나 얻을 수 있지만 두 번째 작업 시트를 삽입 할 때 첫 번째 것과 동일한 arguements를 실행합니다. 액션 시트를 어떻게 seperatly 정의합니까?UIActionSheets 도움말에서 작업 만들기
-(IBAction) phoneButtonClicked:(id)sender
{
// open a dialog with just an OK button
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:self cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:[NSString stringWithFormat:@"Phone: %@",phone],nil];
actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
[actionSheet showInView:self.view]; // show from our table view (pops up in the middle of the table)
[actionSheet release];
}
-(IBAction) mapButtonClicked:(id)sender
{
// open a dialog with just an OK button
UIActionSheet *mapActionSheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:self cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:[NSString stringWithFormat:@"Map"],nil];
mapActionSheet.actionSheetStyle = UIActionSheetStyleDefault;
[mapActionSheet showInView:self.view]; // show from our table view (pops up in the middle of the table)
[mapActionSheet release];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if(buttonIndex == 0){
NSString *callPhone = [NSString stringWithFormat:@"tel:%@",phone];
NSLog(@"Calling: %@", callPhone);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];
}
}