I have what I assume is a fairly standard setup, with one scratchpad MOC which is never saved (containing a bunch of objects downloaded from the web) and another permanent MOC which persists objects. When the user selects an object from scratchMOC to add to her library, I want to either 1) remove the object from scratchMOC and insert int...
In my application i am using core-data to store information and saving these data to the server using web-connectivity i have to use MySql.
Basically what i want to do is to keep track of number of NSManagedObject already created and Whenever i am adding new NSManagedObject, based on that counting it will assign the class a Int_value whi...
Any idea why
//should save the object context.
NSError *error;
if (![managedObjectContext save:&error]) {
NSLog(@"SAVE ERROR");
}
when implemented in a view controller(accessed via a drill down tableview) won't properly save the information? I am passing the moc from the beginning (rootview hands off to tableview, tableview r...
Hi,
I did some changes to my model (but I don't want migration yet, so I just remove the application, built clean etc.)
However, when I run it on the iPhone or in the simulator, I get the following error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'executeFetchRequest:error: A fetch request mus...
Something strange is going on with my iphone app. I am using Core Data to store data in a SQLite database. The first time after my app starts up I try to read a table to return all of the rows to fill a UITableView with a list of things for the user to select from. If they chose the top item in the list I get a EXC_BAD_ACCESS exception. ...
Hello,
I don't understand the output of NSLog for the array returned by a NSFetchRequest.
I'm reading my database and placing the contents in an array, looping through the array and then outputting the contents with NSLog. I don't quite understand the output in the log file. Code below:
-(void)createXMLFeed{
//Fetch details from ...
Hi,
I am using a tableview with data from coredata using nsfetchedresultscontroller. When the view loads i make a new entity using
SomeManagedObject *someManagedObject = [NSEntityDescription insertNewObjectForEntityForName:@"SomeManagedObject" inManagedObjectContext:self.managedObjectContext];
This way the new entity appears in my ta...
I would like to use a single NSManagedObject subclass to represent an item. However, much of the time, the items I will be representing are fleeting, and are not to be saved to the persistent store. It seems like an in-memory store would be the correct setup.
However a few times the user can choose to 'save' an item, and thus I would th...
I have app that stores tree structure in CoreData.
There is an ManagedObject, "Item", and it has attributes:
itemId (string)
List item
title (string)
parentId (string)
parent (relationship to Item)
parentTitle (string)
parentId points to another Item object.
How do I make property parentTitle to be filled automatically with title...
So I have a couple properties that are common across several of my Core Data entities. Notes, URL, etc.
I have a single view controller for editing this information, and I pass the Entity to it as a NSManagedObject
@property (nonatomic, retain) NSManagedObject *editedObject;
@property (nonatomic, retain) Thing *thing;
@property (nonato...
I'm using CoreData (with SQLite as the store) in an iOS 4 iPhone application to store data that i initially retrieve from an xml file. My data model contains more than 15 entities and I am concerned about memory consumption since I saw CoreData creating all the NSManagedObject in memory to represent the object graph of my data model.
I p...
Hi, after I insert a ManagedObject into a context I'd like to fetch it later but before saving the context (I'd save after all objects are inserted). It appears that querying the context later with a fetch concerning those objects returns nothing if the context wasn't previously saved.
Is there a way to save only in the end ?(I guess i ...
I want to create an NSManagedObject with the contents of a NsDictionary. and Visa Versa.
I have a NSDictionary with object and keys that is being brought in from a MYSQL database and stored to the documents directory. I can't find good info for editing a dictionary so I thought I would try NSManaged Object instead.
If the Object attri...
Using CoreData (on an iPhone app) I generated my entity classes from the model and I added some more methods to some ones. It appears that sometimes I get an exception for calling one of those methods. The exception is not random but concerns only some ManagedObject subclass (the others seem to respond correctly).
Here is an example of w...
I am using core data in my iPhone app. I have created a simple class Friend, which derives from NSManagedObject and which uses the following property:
@property (nonatomic, retain) NSString *name;
I am able to add and delete instances of this class to my context and my changes are persistent also.
Now I want to update/modify a Friend-...
Hi. I'm using Core Data to fetch news from the memory and I want to modify the unread attribute after the news is read.
Code:
//method called from within a UITableViewController
-(void) didCloseNews:(NSIndexPath*)indexPath{
//get the newsItem - NewsItem subclasses NSManagedObject
NewsItem* newsItem = [self.fetchedR...
I have some trouble with a core data project. I have a NSArrayController with NSManagedObjects in it, and + / - buttons. If i delete a object in the row after the file has been saved it works perfectly, but if I add a new object, and immediately delete it again (without changing any of the default values), i get an error:
Serious appli...
I'm working on a table view that will display all of a certain type of managed object, and I'm wondering if I should be doing something to prevent faults from firing all the time when the user scrolls and I set up a new cell in the data source?
I don't know too much detail about large amounts of managed objects, (several hundred) but I ...
Hi everybody,
I am a novice in Objective-C; and I could not find any solution in my Books or internet.
My question: What are the most efficient and fastest ways to use already compiled .mom and SQLite db without having the source codes?
Details:
I am trying to connect my small app to the database of another application and use (read-in...
I'm using Core data and region monitoring. The only way to distinguish between monitored regions is with a NSString for identifier. I'd love to use NSManagedObjectID, but I can't get it to work.
What I've tried:
NSURL *objURL = [managedObjectID URIRepresentation];
NSError *err;
NSString *identifier = [NSString stringWithContentsOfURL:m...