I could get the code to work and run successfully but i get this warning to this line
Code:
//â-fired when the user taps on the searchbarâ-
- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar {
isSearchOn = YES;
canSelectRow = YES;
if (searchBar.text.length>0){Local declaration of 'searchBar' hides instance variable
self.tableView.scrollEnabled = YES;
} else {
self.tableView.scrollEnabled = NO;
}
//â-add the Done button at the topâ-
self.navigationItem.rightBarButtonItem =
[[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemDone
target:self
action:@selector(doneSearching:)]
autorelease];
}
This goes to the downloaded code from the author as well.
Secondly, the author showed how we could link the table to another view using
Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *message;
if (isSearchOn && [searchResult count]>0) {
message = [[NSString alloc] initWithFormat:@"You have selected %@",
[searchResult objectAtIndex:indexPath.row]];
} else {
NSString *year = [self.years objectAtIndex:[indexPath section]];
NSArray *movieSection = [self.movieTitles objectForKey:year];
NSString *movieTitle = [movieSection objectAtIndex:[indexPath row]];
message = [[NSString alloc] initWithFormat:@"You have selected %@", movieTitle];
}
if (!self.detailViewController) {
self.detailViewController = [[[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil] autorelease];
}
//â-set the movie selected in the method of the
// MovieDetailsViewControllerâ-//
self.detailViewController.detailItem = [message autorelease];
[self.navigationController
pushViewController:self.detailViewController
animated:YES];
}
How can i link it to another view with a scrollview rather than text message. As in each link has its own scroll view.