Я новичок в разработке приложений для iPhone. В моем коде после того, как я выбрал изображения и нажал законченный rightBarButtonItem, я хочу перейти к таблице, где я показываю все zip-файлы выбранных изображений. Выбор изображений с помощью кнопки done и tableView, оба находятся в разных viewControllers. Скажите, пожалуйста, как перейти к таблицеView, когда я нажимаю кнопку «Готово», изменяя свой код.Как перейти к таблицеView при нажатии кнопки rightBarButtonItem?
Это как мой код выглядит для кнопки проделанной бар:
- (void)updateRightBarButtonItem
{
if (self.allowsMultipleSelection) {
// Set done button
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(done)];
doneButton.enabled = NO;
[self.navigationItem setRightBarButtonItem:doneButton animated:NO];
self.doneButton = doneButton;
}
И это, как мой Tableview код выглядит:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
-(NSInteger) tableView: (UITableView *)tableView numberOfRowsInSection:(NSInteger) section
{
return [filePathsArray count];
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell= [tableView dequeueReusableCellWithIdentifier:@"Main Cell"];
if(cell== nil)
{
cell= [[UITableViewCell alloc]initWithStyle: UITableViewCellStyleDefault reuseIdentifier: @"Main Cell"];
}
cell.accessoryType= UITableViewCellAccessoryDetailDisclosureButton;
for(int i=0;i<[filePathsArray count];i++)
{
if(indexPath.row==i)
cell.textLabel.text=[filePathsArray objectAtIndex:i];
}
return cell;
}
Где я должен включать это? В файле TableView .m или в файле .m-файла готовой кнопки? – vanya
В файле .m в готовой кнопке! – Hemang
Мой проект находится в режиме ARC, так что я должен делать для [addcreateAlarmVC release]; – vanya