How to navigate to the tableView when the rightBarButtonItem is pressed?
I am new for iPhone apps development. In my code, After i select the
images and press the done rightBarButtonItem, i want to navigate to the
tableview where i am displaying all the zip files of the selected images.
The selection of images with done button and the tableView, both are in
different viewControllers. Please tell me as how to navigate to the
tableView when i press the done button by modifying my code.
This is how my code looks for done bar button:
- (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;
}
And this is how my tableView code looks:
- (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;
}
No comments:
Post a Comment