Firstly, what a fountain of knowledge this forum is, more like an oracle for novice coders like myself. Big respect to the creators, moderators and fellow coders " Helping to keep our sanity through the turmoil error's can cause".
Please also excuse the lack of articulate expression I may purvey as I this is week 4 of my SDK endeavor.........I suppose u have all been there!
OK, so here is the bugity bug.
I have basically used the ready made CoreData Recipes' app that Apple kindly supply as a template and built my own version from the ground up using the same code.
My version will run if i remove this error report from the code from my version of RecipeListTableViewController.m
This if removed as I say, will allow the app to run BUT without any data being forwarded to my TableView.
I have narrowed the issue down to this part of my code again in my version of RecipeListTableViewController.m:
I have manually checked the SQLite DB and the info appears to be getting written correctly (if I remove the above mentioned error tag, I can get to the 'Add recipe' page etc.) it just will not fetch the data to build the tableView grrrrrr.
The debugger with bt shows as follows :
Your help, advise and suggestions are greatly appreciated.
If you need any further info, please ask!
DetartrateD
Please also excuse the lack of articulate expression I may purvey as I this is week 4 of my SDK endeavor.........I suppose u have all been there!
OK, so here is the bugity bug.
I have basically used the ready made CoreData Recipes' app that Apple kindly supply as a template and built my own version from the ground up using the same code.
My version will run if i remove this error report from the code from my version of RecipeListTableViewController.m
Code:
- (void)viewDidLoad {
// Configure the navigation bar
self.title = @"Hall of fame!";
self.navigationItem.leftBarButtonItem = self.editButtonItem;
UIBarButtonItem *addButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemA dd target:self action:@selector(add)];
self.navigationItem.rightBarButtonItem = addButtonItem;
[addButtonItem release];
// Set the table view's row height
self.tableView.rowHeight = 44.0;
NSError *error = nil;
if (![[self fetchedResultsController] performFetch:&error]) {
/* Replace this implementation with code to handle the error appropriately.
abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. If it is not possible to recover from the error, display an alert panel that instructs the user to quit the application by pressing the Home button.
*/
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
}
I have narrowed the issue down to this part of my code again in my version of RecipeListTableViewController.m:
Code:
#pragma mark Fetched results controller
- (NSFetchedResultsController *)fetchedResultsController {
// Set up the fetched results controller if needed.
if (fetchedResultsController == nil) {
// Create the fetch request for the entity.
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
// Edit the entity name as appropriate.
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Fish" inManagedObjectContext:managedObjectContext];
[fetchRequest setEntity:entity];
// Edit the sort key as appropriate.
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"species" ascending:YES];
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptors, nil];
[fetchRequest setSortDescriptors:sortDescriptors];
// Edit the section name key path and cache name if appropriate.
// nil for section name key path means "no sections".
NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:managedObjectContext sectionNameKeyPath:nil cacheName:nil];
aFetchedResultsController.delegate = self;
self.fetchedResultsController = aFetchedResultsController;
[aFetchedResultsController release];
[fetchRequest release];
[sortDescriptor release];
[sortDescriptors release];
}
return fetchedResultsController;
}
I have manually checked the SQLite DB and the info appears to be getting written correctly (if I remove the above mentioned error tag, I can get to the 'Add recipe' page etc.) it just will not fetch the data to build the tableView grrrrrr.
The debugger with bt shows as follows :
Code:
2011-03-24 09:18:38.242 iFishWiki[3376:207] -[UITableView key]: unrecognized selector sent to instance 0x5038000
(gdb) bt
#0 0x010fb5a8 in objc_exception_throw ()
#1 0x00fa86fb in -[NSObject(NSObject) doesNotRecognizeSelector:] ()
#2 0x00f18366 in ___forwarding___ ()
#3 0x00f17f22 in __forwarding_prep_0___ ()
#4 0x00db5c60 in -[NSFetchedResultsController initWithFetchRequest:managedObjectContext:sectionN ameKeyPath:cacheName:] ()
#5 0x0000334b in -[BestFishTableViewController fetchedResultsController] (self=0x6027be0, _cmd=0x11d1c) at /Users/antonycollins/Documents/iFishWiki/Classes/BestFishTableViewController.m:201
#6 0x00002aa7 in -[BestFishTableViewController viewDidLoad] (self=0x6027be0, _cmd=0x6fc49e) at /Users/antonycollins/Documents/iFishWiki/Classes/BestFishTableViewController.m:40
#7 0x0038665e in -[UIViewController view] ()
#8 0x00384a57 in -[UIViewController contentScrollView] ()
#9 0x00395201 in -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewCont roller:] ()
#10 0x00393831 in -[UINavigationController _layoutViewController:] ()
#11 0x00394b4c in -[UINavigationController _startTransition:fromViewController:toViewControll er:] ()
#12 0x0038f606 in -[UINavigationController _startDeferredTransitionIfNeeded] ()
#13 0x004a7e01 in -[UILayoutContainerView layoutSubviews] ()
#14 0x01e64451 in -[CALayer layoutSublayers] ()
#15 0x01e6417c in CALayerLayoutIfNeeded ()
#16 0x01e5d37c in CA::Context::commit_transaction ()
#17 0x01e5d0d0 in CA::Transaction::commit ()
#18 0x002db19f in -[UIApplication _reportAppLaunchFinished] ()
#19 0x002db659 in -[UIApplication _runWithURLayload:launchOrientation:statusBarSty le:statusBarHidden:] ()
#20 0x002e5db2 in -[UIApplication handleEvent:withNewEvent:] ()
#21 0x002de202 in -[UIApplication sendEvent:] ()
#22 0x002e3732 in _UIApplicationHandleEvent ()
#23 0x018dca36 in PurpleEventCallback ()
#24 0x00f88064 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FU NCTION__ ()
#25 0x00ee86f7 in __CFRunLoopDoSource1 ()
#26 0x00ee5983 in __CFRunLoopRun ()
#27 0x00ee5240 in CFRunLoopRunSpecific ()
#28 0x00ee5161 in CFRunLoopRunInMode ()
#29 0x002dafa8 in -[UIApplication _run] ()
#30 0x002e742e in UIApplicationMain ()
#31 0x00001e80 in main (argc=1, argv=0xbfffefa0) at /Users/antonycollins/Documents/iFishWiki/main.m:13
(gdb)
Your help, advise and suggestions are greatly appreciated.
If you need any further info, please ask!
DetartrateD
Last edited: