sharedApplication is unavailable

342 Views Asked by At

I'm trying to access my core data from the watch kit extension but i'm unable to use the shared application because it's not available in watch kit. How do I initialize the managedObjectContext within my view controller without using the shared application code?

    if (self.managedObjectContext_ == nil) {
    self.managedObjectContext_ = [(AppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext];
}

right now, it's assuming my managedObjectContext is nil.

0

There are 0 best solutions below