in my App I've two TableViewControllers, in very first I've selected few rows randomly with a Favorite Button and saved their indexPath.row
in a separate MutableArray
then I Tried to access only those selected rows in second TableViewController and I used following code,
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return rArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
Radio * RadioObject;
RadioObject = [rArray objectAtIndex:indexPath.row];
if([rFavorites containsObject:[NSNumber numberWithInt:(int)indexPath.row]])
cell.textLabel.text = RadioObject.radioTitle;
else
cell.frame = CGRectZero;
return cell;
}
it giving me follow result. when selected three cells from first TableViewController
& Stored their result in a MutableArray
here is its NSLog
result
Favorite Radios array is (
10,
8,
9
)
and now in Simulator
]1
the thing which I am willing to do is to remove other empty cells from this TableViewController. so please suggest me how to accomplish that?