происходит сбой приложения в приложении ipad - PullRequest
0 голосов
/ 19 марта 2012

В моем приложении у меня есть 2 кнопки с правой стороны панели навигации. Я добавил эти кнопки в пользовательскую панель инструментов, а затем добавил ее на панель навигации. Используемый код: *

- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController
   {
         barButtonItem.title = NSLocalizedString(@"Menu", @"Menu");
         buttons=[[[NSMutableArray alloc]initWithCapacity:2]retain];
         tools = [[[UIToolbar alloc]initWithFrame:CGRectMake(0.0f, 0.0f, 103.0f, 44.01f)]retain];
         tools.barStyle = -1; 
  UIBarButtonItem *bi = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh   target:self action:nil];
         bi.action = @selector(ButtonClick:);
         [buttons addObject:barButtonItem];
         [buttons addObject:bi];
         [tools setItems:buttons animated:YES];
         UIBarButtonItem *twoButtons = [[UIBarButtonItem alloc] initWithCustomView:tools];
[tools release];
         self.navigationItem.leftBarButtonItem = twoButtons;
         self.masterPopoverController = popoverController;
       }

 -(void)ButtonClick:(id)sender
     {
        HomeViewController *controller = [[[HomeViewController alloc]initWithNibName:@"HomeViewController" bundle:nil]retain];
     [self presentModalViewController:controller animated:YES];
      }

Затем обе кнопки добавляются во все виды. Но при попытке нажать на кнопку обновления, добавленную из любых других видов, приложение вылетает . Кто-нибудь может предложить решение для этого?Исключение, которое я получаю, выглядит так:
[DetailViewController executeSelector: withObject: withObject:] сообщение, отправленное на освобожденный экземпляр 0x913c140

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...