Like so many who have come before me - I'm starting this with "I'm new to iOS programming"; I've asked a few questions here and there.
I've got a project that I'm getting setup using tabbar project.
I've got 4 tabs at the bottom, one of which is "edit", when the user clicks that they're shown a view with a month picker on it. When they select the month - the screen should load a tableview that is populated with the appropriate months entries from coredata.
I have coredata setup in my App Delegate - but I'm curious how I would then get the information into my tableview deeper in the app?
I've worked through THIS TUTORIAL on coredata and have been able to get it to work when doing master-detail project, but this is a tabbar project I'm working within.
I've been using the storyboard for most of my layout.
I keep getting errors when I try to use this line in the viewDidLoad:
NSManagedObjectContext *context = [self managedObjectContext];
The error is:
No visible @interface for 'myEditPageViewController' declares the selector 'managedObjectContext'
My imports are:
#import "myEditPageViewController.h"
#import "myAppDelegate.h"
#import "CoreData/CoreData.h"
My current viewDidLoad looks like this (which I got from some digging online - remember, I'm pretty new to this stuff):
self.context = [self context];
if (self.context == nil)
{
self.context = [(myAppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext];
}
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc]init];
NSManagedObjectContext *context = [self managedObjectContext];
Any thoughts? I'm trying to apply that tutorial to my app - but since it's not master-detail there are other views involved. Just trying to get it working to display the coredata info!