core-data

Using an NSFetchedResultsController without a UITableViewController

I'm running into problems trying to use a NSFetchedResultsController without a corresponding UITableViewController. According to Apples documentation: "NSFetchedResultsController is intended to efficiently manage the results returned from a Core Data fetch request to provide data for a UITableView object." So I first researched whethe...

Core Data executeFetchRequest throws NSGenericException (Collection was mutated while being enumerated)

I'm developing a iPhone app with Core Data. All user data should be synchronized with our servers. For this purpose I created a subclass of NSOperation witch loads new data from our web service and creates corresponding managed objects. To maintain the relationships between them, every object is transmitted with a remoteID (which is the ...

Core Data - save existing managed object and show it in an another view

I'm working on an table drill-down style iPhone app that has prepopulated data. I use Core Data and NSFetchedResultsController to populate the table views. In the last level of the table view which shows an item (managed object) I want my user to be able to select that item which should eventualy be shown in another view. That other view...

Core Data app don't load data from persistent store

Hi all, I've any problems for app I'm developing... I'm using Core Data and I just write initial code... But one of my problem is: Core Data won't load data stored in persistent store... This is my code! MyWishesAppDelegate.h #import UIKit/UIKit.h #import CoreData/CoreData.h @interface MyWishesAppDelegate : NSObject { UIWindow ...

NSManagedObject sublcass conform to the <MKAnnotation> protocol?

My main problem is storing the data which is not supported by Core Data. I already have a CLLocation property stored as a transformable attribute. I think the right approach is to declare a transient coordinate property. I keep getting EXC_BAD_ACCESS errors however. EDIT: My current subclass has the following interface: #import <Found...

Core Data, MOCs, and multi-threading

A conceptual question: I have data stored hierarchically via Core Data SQLite for an iPhone app. I wish both to draw AND to perform calculations based upon properties of each object in the entire hierarchical arrangement of objects. Both drawing and calculating tasks access the same exact properties. Simple enough. However, I anticipate...

CoreData and Shared ManagedobjectContext in TabBar iphone app.

I a, working on coredata iphone TabBar app and passing appdelegate managedObjectContext to all the views and subviews.At some instance i need to create new record for entity A and while entity A didn't saved by the user i need to create another entity B by using the same shared context. Now, my problem is if i save the context for entity...

Sectioning on Core Data relationship for a UITableView

I have 2 entities - BlogEntry and BlogComments. BlogEntry.comments is a "to many" relationship to BlogComments | BlogEntry | ----------------- | subject | | body | | comments (rel)| | BlogComments | ------------------ | commentText | | blogEntry (rel)| Now, I have a tableview that I want to be able to have ...

Can CoreData models be exported to use in another app?

Is there any way to export a CoreData model file (i.e entities description: *.xcdatamodeld) to another project. Because re-recreate all entities is boring :-) ...

Crash (SIGSEGV) in Core Data internal methods

Hi, I got a crash report and the crashing thread's call stack all show Apple's code. From the looks of it, Core Data's undo manager is accessing an invalid pointer in -[NSManagedObject(_NSInternalMethods) _newSnapshotForUndo__] + 356. I've googled the point of crash and the only other similar crash log I found was from Sequel Pro cras...

Create UIColor from NSColor Data

I have a CoreData Mac app for which I'm writing an iOS front end. All's working well thusfar, I'm able to successfully read files created with the Mac app in the iOS version. I'm struggling with how to read the NSColor data (being stored as an NSData object in my data model) into a UIColor in iOS version of the app. To summarize: How ...

New Core Data entity identical to existing one: separate entity or other solution?

Overview: I'm designing a restaurant management application, and I have an entity called Order which has Items. Since a restaurant can operate for many years, with many thousands of completed 'orders', and in the interest of making the networking side of my application easier and keeping the database fast, I want to introduce the concept...

Efficiently keep records of each change to some Core Data relationships

I'm designing a Core Data app which needs to keep dated records. Imagine a user works with the program for a while and some records are stored. The user then changes important attributes and relationships (which transcend individual records), and continues using the program with this new configuration. Imagine now that the user looks ba...

App crashes when reloading tableView with new data

Hi all, I've got a view containing a segmentedControl and a tableView. The tableView is populated depending on the segmentedControl item that is selected (in this case Food and wine). The data for the tableView is generated from coreData. It works fine when starting up the application which any of the segmentedControl items selected (...

NSString unexpectedly becomes __NSCFDictionary

Hi guys, I have this very strange problem, I'm new to objective-c and it probably comes from depths which I don't comprehend yet. So, in my header file I declare the variable NSString *curTitle; then in .m file I synthesize it: curTitle = [[NSString alloc] init]; after that in other method I assign it: curTitle = string; // strin...

Core Data undo coalescing for an action spanning multiple run loop cycles

I have a Core Data based UIKit application that allows the user the drag objects around on the screen. While an object is being dragged, I update its position attribute on each touchesMoved: event. To support undoing a drag operation in one go, I start a new undo group at the beginning of the drag, and end the group when the user lifts ...

Core Data - NSFetchRequest Problem

Hello, I have a problem with my NSFetchRequest, it doesn't seem to be fetching any data, code below: -(void)addAnnotations { NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"WayPoint" inManagedObjectContext:managedObjectContext]; [request se...

Hi guys, how can I executeFetchRequest second time if the first time CoreData was empty

Hi guys, I'm developing an application, which parses XML ant put data to CoreData. I want it to start quickly, so I load data from CoreData first, and after load and parse XML in other thread. The problem is that when the app starts first time CoreData is empty and I start to parse: NSFetchRequest *request = [[NSFetchRequest alloc] init...

What exactly is 'indexing' in Core Data?

As an answer to a question I asked yesterday (http://stackoverflow.com/questions/3293832/new-core-data-entity-identical-to-existing-one-separate-entity-or-other-solution), someone recommended I index an attribute. After much searching on Google for what an 'index' is in SQLite/Core Data, I'm afraid I'm not closer to knowing exactly what...

iPhone SDK Core Data relationships problem

Hello.. I'm having a problem with relationships between to entities in Core Data. I'm parsing some JSON and adding the entities: if ([hourSets isKindOfClass:[NSArray class]]) { // check to see that we have got some hours back for (NSDictionary *hourSet in hourSets) { Hourset *thisHourSet = (Hourset *)[NSEntityDescription ...