I get the following error:
'NSInvalidArgumentException', reason:
'Illegal attempt to establish a
relationship 'condition' between
objects in different contexts
when running my iphone app. The relevant part of my model looks like this:
AssessmentTree
-has one TreeCrown
TreeCrown
-has one TreeCrownCondition
-has one Assessme...
I keep getting crashes from a save: command on a managedObjectContext. It doesn't even fulfill the NSLog statement so I don't see the unresolved error statement, so I can't figure out what the problem might be. It doesn't happen every time, but only sporadically.
Here's the code (which basically wants to increment a counter):
if ([[...
Hi there
I've set up my project with the "use coredata" option set.
XCode obviously set all this up for me automatically, and now I have these lines in the app delegate header file:
@interface GFree2AppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
GFree2ViewController *viewController;
UINavigationControll...
I get an annoyingly vague error from the following code:
GFree2AppDelegate *delegate = [[UIApplication sharedApplication] delegate];
context = [delegate managedObjectContext];
context is defined as a NSManagedObjectContext in the .h file and is the same in the delegate. All the right files seem to be included (except for <CoreData/Cor...
In core data for the iPhone, I was getting all sorts of errors trying to save data to a NSManagedObjectContext.
I believe that my issues were all to do with me using a `NSManagedObjectContext' that was being used in multiple threads.
So I wanted to create a new NSManagedObjectContext and try that, but I cannot find the example code to ...
I'm a pretty comfortable CoreData user. I had a problem that was absolutely killing me, figured out what was going wrong and have NO CLUE why it was causing the problems I was seeing. Can anyone explain this?
Okay, we have a main MOC that does most the 'read-only' data work and handles simple write operations. When we're about to do a b...
Hi All
I need to edit a row of data in an Entity that has a relationship with my main Entity from my fetchedResultsController, in this case "theUser" being an instance of my User entity.
I basically need to edit one of the CannedMessage rows that already exist and save it. I can access the "Messages" fine as you see below, but am unsur...
I keep getting the error "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[MainViewController minimalFormInContext:]: unrecognized selector sent to class"
from this line of code:
NSLog(@"Accessing specific mine entities");
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Mine" inMa...
Reference POST:
http://stackoverflow.com/questions/3681003/core-data-basic-questions
I am able to get the Managed object context from this piece of code. It bring me to another question. I have 2 VIEW CONTROLLERS and 1 NSObject
Userlookup (VC)
UserlookupSettings(VC)
FetchProcessor (NSObject)
In sequence, Userlookup vc loads first a...
I have a common application pattern: user enters data in the main view controller, then views it in a table in a modal view controller, where rows can be deleted or modified. I was following the general design strategy from the Stanford iPhone course, but somewhere things went off the rails and all I've been getting is SIGABRT's and exc...
Hello,
I would like to know if I can do this
VIEW 1: use NSFetchedResultsController on TABLEA to retrieve the data, display in a table view and take actions to save it
NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:referringObject ...
I currently have an NSManagedObjectContext containing 5 Video Objects displayed in a table view.
When a user selects a row, I'm going to push in a new view controller to display object details, and give the user the option to 'add Video to favorites'.
To do this, I want to create a new NSManagedObjectContext, assign the selected Video ...
Hi all
I have a MOC created in my AppDelegate class. I have a MOC property in my RootView which is set by the AppDelegate with something like:
rootView.managedObjectContext = self.managedObjectContext;
This rootView creates at some time a ModalView and sets there a MOC property also by the same way.
Everything works fine. I can crea...
I am trying to use NSManagedObjectContext dependency injection as recommended by Marcus Zarra -- I'm creating an M.O.C. in my AppDelegate and passing it as a retained property to each of my view controllers.
Generally this seems to work well, but in a modal table view controller that presents data via an NSFetchedResultsController, I on...
Hi guys
I'm new to iphone development and have this problem with Core Data.
At the moment my app works as follows:
I'm executing a fetch from Core Data and display my list of objects in TableView
Detaching new thread, create new MOC for it, as advised,
Getting xml, parse it, then clear Core Data and fill it with new data from xml
Sav...
Hi
I have a nice working iphone app that works with core data. I use a NSFetchedResultsController/NSManagedObjectContext as described in various tutorials.
Now I want to extends my app and add some more features. The problem I need to build up an array with objects that have informations from my data.
I somehow need to get a list of a...
Hi, I'm a first time Core Data user/learner for iPhone, I thought that [managedObjectContext save:$error] was used to save changes to the Persistant Store.
But when I reload and call NSFetch, the objects are still there. Any ideas why?
for (int i ; i < [mutableFetchResults count];i++)
{
NSManagedObject *toDelete = [mutableFetchResu...
Hi,
I'm relatively new to iPhone dev and have been trying to build an application to understand how CoreData works.
I'm trying to implement some functionality that will allow me to detect if anything has been persisted to store and if so - give the user the option to delete those objects.
I wondered if there are timing issues that nee...
I have an app which is based on the Utility template (where you flip over the view to see another). On the first view there is a login screen, then it flips over to reveal a UITabBar style interface.
I'm having trouble working out how to pass the managedObjectContext from the App Delegate (where it is created) all the way through to eac...
Hi friends,
I did a program using core data and saved it in my desktop. The entities, relationships are available in .xcdatamodel file. Then i copied my entire program into some other folder in disk and erased the original file placed in desktop.
Now the copied program did not work. The managed objects are null. What changes must i do ...