So I have a group of friends testing my app, and the one person on an iPhone 4 says that the app crashes when he presses the "Go" button attached to my PickerView.
A bit of background: A user selects values in the PickerView, and then presses "Go". Once "Go" is pressed, it searches the database for the user's selected values, and displays results in a TableView.
That said, it works for the other two friends (on a 4S and an iPhone 5). Does anyone know why this might be? See code (point of the crash) below.
pickerviewcontroller.m
- (IBAction)buttonpressed:(UIButton *)sender {
NSLog(@"Button Pushed!");
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Make sure your segue name in storyboard is the same as this line
if ([[segue identifier] isEqualToString:@"pickerGo"])
{
NSLog(@"%@", Strains);
// Get reference to the destination view controller
PickerResultsTableViewController *PickerTableView = [segue destinationViewController];
NSLog(@"%@", PickerTableView);
NSPredicate *ailmentPredicate = [NSPredicate predicateWithFormat:@"Ailment CONTAINS[c] %@", [array1 objectAtIndex:[pickerView selectedRowInComponent:0]]];
NSPredicate *actionPredicate = [NSPredicate predicateWithFormat:@"Action CONTAINS[c] %@", [array2 objectAtIndex:[pickerView selectedRowInComponent:1]]];
NSPredicate *ingestPredicate = [NSPredicate predicateWithFormat:@"Ingestion CONTAINS[c] %@", [array3 objectAtIndex:[pickerView selectedRowInComponent:2]]];
NSCompoundPredicate *resultPredicate = [NSCompoundPredicate andPredicateWithSubpredicates:[NSArray arrayWithObjects: ailmentPredicate,actionPredicate,ingestPredicate, nil]];
searchResults = [Strains filteredArrayUsingPredicate:resultPredicate];
// Pass any objects to the view controller here, like...
[PickerTableView setSearchResults: [searchResults copy]];
NSLog(@"%@", searchResults);
}
}