Hi, I'm implementing a Search bar, everything is ready except I need to copy all of my Dictionary Titles to an array called listOfRecipes. I already have to path to access them, which is the following:
If I try to type that in ViewDidLoad, it tells me : Use of undeclared identifier "indexPath" both for section and for row. I know it's because they only work inside index methods. But how can I adapt it for ViewDidLoad ? Some tutorials use a different copy method for that.. this is an example of one of them:
Here a photo of the plist, Thank you
Code:
NSUInteger section = [indexPath section];
NSUInteger row = [indexPath row];
NSString *key = [keys objectAtIndex:section];
NSArray *nameSection = [names objectForKey:key];
Something = [[nameSection objectAtIndex:row]valueForKey:@"Title"];
If I try to type that in ViewDidLoad, it tells me : Use of undeclared identifier "indexPath" both for section and for row. I know it's because they only work inside index methods. But how can I adapt it for ViewDidLoad ? Some tutorials use a different copy method for that.. this is an example of one of them:
Code:
//---copy all the movie titles in the dictionary into the listOfMovies array---
listOfRecipes = [[NSMutableArray alloc] init];
for (NSString *year in array) //---get all the years---
{
//---get all the recipes for a particular category---
NSArray *movies = [movieTitles objectForKey:year];
for (NSString *title in movies)
{
[listOfRecipes addObject:title];
}
}
Here a photo of the plist, Thank you