So I have a class, that at this point only contains a simple NSMutableArray object. I'm setting this object from a view controller but for some reason... the silly thing doesn't work on my ipad. It works flawlessly on the simulator however.
Has anyone ever come across this scenario?
I know that's not a whole lot to go on but any tips/pointers on where to look would even be helpful. No idea what to search for on this one.
Thanks
ViewController.h
#import "DBEntries.h"
DBEntries *dbEntries;
ViewController.m:
[database open];
NSMutableArray *arrayAdder = [[NSMutableArray alloc] init];
NSString *filterNameFirst = [NSString stringWithFormat:@"%@", nameFirstTextField.text];
NSString *filterNameLast = [NSString stringWithFormat:@"%@", nameLastTextField.text];
NSString *filterStringFirst = [NSString stringWithFormat:@"%%%@%%", filterNameFirst]; // Works on first name only.
NSString *filterStringLast = [NSString stringWithFormat:@"%%%@%%", filterNameLast]; // Works on last name only.
FMResultSet *results = [database executeQuery:[NSString stringWithFormat:@"SELECT * FROM users WHERE firstname LIKE ? AND lastname LIKE ?", filterStringFirst, filterStringLast]];
while([results next])
{
NSString *firstname = [results stringForColumn:@"firstname"];
NSString *lastname = [results stringForColumn:@"lastname"];
// Add db entries to array in DBEntries.
NSString *objectAdder = [NSString stringWithFormat:@"%@ %@", firstname, lastname];
NSLog(@"objectAdder: %@", objectAdder);
[arrayAdder addObject:objectAdder];
}
[dbEntries setUsersFiltered:arrayAdder];
[arrayAdder release];
[database close];
isUpdatingEntriesForTableView = YES;
[dbTableView reloadData];
NSLog(@"dbEntries.usersFiltered: %@", dbEntries.usersFiltered); // This logs 0 on device, but works on simulator.
class.h:
NSMutableArray *usersFiltered;
@property (strong, nonatomic) NSMutableArray *usersFiltered;
class.m:
@synthesize usersFiltered;