1

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);
    }
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579
Brittany L
  • 131
  • 1
  • 13
  • Do you know where is it crashing (which line)? – Abdullah Shafique Aug 21 '13 at 15:49
  • 1
    More than the device models, it'd be more interesting to know about specific iOS versions, and the crash log, if you have it at hand. – Daniel Martín Aug 21 '13 at 15:50
  • I don't, as I can't seem to recreate the error. I even ran it in the iPhone 4 simulator, and no crash. That said, when I send him the ipa file, and he installs it to his phone, the picker crashes. I suspect it might be this line: NSCompoundPredicate *resultPredicate = [NSCompoundPredicate andPredicateWithSubpredicates:[NSArray arrayWithObjects: ailmentPredicate,actionPredicate,ingestPredicate, nil]]; – Brittany L Aug 21 '13 at 15:51
  • You'll need to provide something more if you want anyone to help you. – trojanfoe Aug 21 '13 at 15:52
  • @DanielMartin, everyone is using the same iOS version (iOS6), and everyone's version is up to date. – Brittany L Aug 21 '13 at 15:52
  • 2
    You can get him to send you the crash report from his device so you can check the details. – Wain Aug 21 '13 at 15:54
  • Without the crash log it's difficult to say something. See this article: https://developer.apple.com/library/ios/qa/qa1747/_index.html – Daniel Martín Aug 21 '13 at 15:57
  • @Wain I'll do that! Thanks :) Will let you know what I find lol. – Brittany L Aug 21 '13 at 15:58
  • You mention database...would you be referring to core data? – Jeremy Aug 21 '13 at 15:59
  • It might help if you ask your friend with the iPhone 4 to delete and reinstall your app. That way, if his problem is due to some action he took within your app that messed up his data somehow, he’ll be back to a standard state. – bdesham Aug 21 '13 at 15:59
  • You DEFINITELY want to know his OS version. Also, using TestFlight for this kinds of testing is great, since then you'll already have his OS on file, so you won't have to ask. (Lots of other benefits of TestFlight too.) – Fluffhead Aug 21 '13 at 18:28
  • Crash report from the phone = genius. Didn't know you could do that. Also, @Fluffhead, TestFlight rocks. Thanks! -B – Brittany L Aug 22 '13 at 05:40

0 Answers0