на главном экране: навигационный контроллер, щелчок по строке, вызов подробного вида и добавление кнопки
.
seminareListinView.m
#import "SeminareListingView.h"
#import "Seminar.h"
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//gehe zurück zum ersten View
//NSLog(@"Received Data in seminareArray");
Seminar *dvController = [[Seminar alloc] initWithNibName:@"Seminar" bundle:nil];
NSString *selectedSeminarURL = [seminarURLArray objectAtIndex:indexPath.row];
//NSString *selectedNextXMLFile = [kategorienNextXMLFileArray objectAtIndex:indexPath.row];
dvController.seminarURLFromXML = selectedSeminarURL;
//dvController.XMLFile = selectedNextXMLFile;
[self.navigationController pushViewController:dvController animated:YES];
//Zeige den PDF Download Button
UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithTitle:@"PDF Download" style:UIBarButtonItemStylePlain target:self action:@selector(showMenu)];
//anotherButton.action = @selector(showMenu);
dvController.navigationItem.rightBarButtonItem = anotherButton;
[anotherButton release];
[dvController release];
dvController = nil;
//[[self navigationController] popViewControllerAnimated:YES];
}
в режиме просмотра семинара есть этот метод
seminar.m
- (void) showMenu
{
UIActionSheet *myMenu = [[UIActionSheet alloc]
initWithTitle: @"Überschrift"
delegate:self
cancelButtonTitle:@"Abbrechen"
destructiveButtonTitle:@"Etwas unwiderrufliches"
otherButtonTitles:@"Eins", @"Zwei", nil];
[myMenu showInView:self.view];
}
но я получаю ошибку, нажав на кнопку
2011-07-07 12:57:31.009 Seminar App2[4352:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SeminareListingView showMenu]: unrecognized selector sent to instance 0x6305f90'
*** Call stack at first throw: