I have a web service call that returns XML which I convert into domain objects, I then want to insert these domain objects into my Core Data store.
However, I really want to make sure that I dont insert duplicates (the objects have a date stamp which makes them unique which I would hope to use for the uniqueness check). I really dont w...
In order to properly learn Objective-C and the Cocoa framework, I have started building a CoreData application, but I'm a bit at a loss on how to properly provide data validation when an item is being edited in an NSTableView.
My model has an entity called "Business" with two string properties: a name and an issued tax number. The secon...
Hello,
My app is crashing when testing on the device, but not on the simulator. It happens when I go to log out. I'm deleting all records from core data when the user logs out, code as follows:
-(IBAction)logOut
{
UIAlertView *getConfirmation = [[UIAlertView alloc] initWithTitle:@"Confirm" message:@"Are you sure you want to logout...
I have taken (with the authors permission on the site) a wrapper class for writing fetch requests to my Core Data stack.
The guy who wrote it says it has "optional parameters" and I wondered what this meant.
Anywho, the static methods are written as such...
+(NSMutableArray *) searchObjectsFromContext
: (NSString*) entityName
...
Hi the problem goes like this:
I have in CoreData entities that have a title and a relationship to keywords entities.
I need a predicate that helps me to fetch all those entities whose title contains the keywords I type. I have the code below that should do this but it doesn't:
NSArray *keywords = [searchString componentsSeparatedByS...
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. I've got a core data app with 2 views. The first view lists "Rooms", the second lists "Scenes" in rooms. The Rooms page has an edit NavItem button, which when pressed enables an add NavItem button. You can delete and add rooms from here. Added rooms simply appear with a default "New Room" name in the table. The second view is a list ...
When my sqlite database is created using a core data model, at this line:
if (![persistentStoreCoordinator_ addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:options error:&error])
I get an error:
NSUnderlyingException=I/O SQLite error code:1, 'no such table: Z_METADATA'
Any idea ...
I'm finishing my second book on iPhone development (Beginning Iphone 3 Development - Mark/LaMarche) and, while this book covers the 4 main persistence mechanisms, I'm still not sure which one to use for my application. My data model is not very intricate, but I do need some relationship definition and functionality.
So what are the sea...
I am having a hard time wrapping my head around data models. Let me start with showing how I would declare the class if I just had to have in-memory objects.
@interface PlayerState {
NSSet /* of SavedDie */ *savedDice;
NSSet /* of SavedDie */ *immediateRolls;
}
@property (nonatomic, retain) NSSet *savedDice;
@property (nonatomic,...
Hi everybody,
I have a problem with a bound property of a custom view. The property is bound to an NSArrayController for a core-data entity.
Here's the problem:
In my view, I draw several rectangles. The positions of these rectangles are saved in an entity in core data (as NSValue wrapped NSRects). The rectangles are draggable, and wh...
I have two entities: Folder <-->> Document, and Folder defines a To-Many relationship to Document with a cascade delete rule. My question is: is there some way for document object itself to detect when it is cascade deleted ?
...
If I have entities set up for Parent - Child - Grandchild and one to many relations between them I know I can then get all the Child entities for a parent or all the Grandchild Entities for a Child.
Is it possible to run a fetch that will get all the Granchild entities for a given Parent?
Thanks for any help!
...
Hi, I'm supporting deleting rows in a UIView that includes a tableView:
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
[self.fetchedResultsController.managedObjectContext
...
Hello,
I am playing with an app that uses Core Data and NSManagedObjects to populate a UITableView. There is only one class in my application, called Event. I have created the following custom instance method on Event:
- (BOOL)isExpired {
return ([[self.endOn dateAtEndOfDay] timeIntervalSinceNow] < 0);
}
I would like to limit t...
I've added a new field to an SQLite db table and have also added a new attribute in core data xcdatamodel. I made sure to delete the app from the iphone simulator.
the app runs fine, but isn't finding the new field. if i change the data on an existing field in SQLite and relaunch the app, the change is there. the new field is not.
anyo...
For those of you making iphone applications that record video
Are you utilising the camera roll for storage and then indexing the asset URL?
Or are you somehow saving the video to the app / bundle / database?
Does the stackoverflow community think it is viable to just store the asset url for replaying or that one should somehow store...
I have an entity with an transient attribute, and it's optional flag is set to NO.
If I fetch an instance of this entity from persistent store, change something and save back, need I set this transient attribute ?
...
I'm pretty new to Core Data and managed to get the NSTableView to show my Core Data values. The entity that the table uses is Emotes that have the two properties, Emote (string) and Usage (integer 16)
When a user selects a item, it will allow a person to copy that emote to clipboard. In order to do that, I need to get the ManagedObject ...
I have an sqlite table that I'd like to add a new field to. Would I add the new field directly in sqlite or does the Core Data model change the sqlite table itself?
I'm stuck for some reason right now w/ adding a new field to the db table. thanks for any help.
...