I have an entity in core data called Location. Inside this I have a few fields, such as date. But, I would also like to save a class object in it that I created called Annotation. What type of attribute would I use for this, since it is a custom class object that I created?
Location (object)
|__ Date
|__ Annotation (MKAnnotation prot...
When creating an NSFetchedResultsController instance, there is this sectionNameKeyPath: argument, which most peoeple seem to set to nil. Now lets say I have Employees in the table view and I want that they're sectioned by their street address streetName. Every Employee is associated with an StreetAddress Property. So I would put an @"add...
NSFetchedResultsController *frc = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:moc sectionNameKeyPath:nil cacheName:@"Root"];
Why do we have to think about a cacheName? How important is this decision? What would happen if there are two NSFetchedResultsController instances using the exact sa...
I recently tried a lot of different stuff with lightweight migration. These all work:
1) Rename attributes (with renaming identifier specified)
2) Add attributes
3) Add new entity + new attribute + inverse relationship to an already existing entity
4) remove existing entity + relationships to that entity
= It almost looks like jus...
One think I notices is, that I must probably keep the whole stack of model versions intact when shipping updates. I am not sure what happens if someone has version 1.0 with populated data, and then instantly updates to version 5.0 without any of the versions inbetween. So the migration must also know what was that very first data model l...
Example: User installs app v.1.0, adds data. Then the dev submits 10 updates in 10 weeks. After 11 weeks, the user wants v.11.0 and grabs a copy from the app store.
Assuming that the app has got 11 .xcdatamodel versions inside, where ***11.xcdatamodel is the current one, what would happen now since the persistent store of the user is a...
I've created an NSUndoManager for the Managed Object Context of Core Data, like this:
NSUndoManager *undoManager = [[NSUndoManager alloc] init];
[undoManager setLevelsOfUndo:10];
[managedObjectContext setUndoManager:undoManager];
[undoManager release];
In the app delegate where the didFinishLaunching method is called, I did this:
app...
Example:
[[managedObjectContext undoManager] disableUndoRegistration];
// changes which shouldn't be undo-able
[managedObjectContext processPendingChanges];
[[managedObjectContext undoManager] enableUndoRegistration];
Is that really important? What's the point?
...
Hi all,
I am working on i-Phone app targeting 3.1.3 and later SDK. I want to know the best way to store user's long term data on i-phone without losing performance, consistency and security.
I know, that i can use Core Data, PList and SQL-Lite for storing user specific data in custom formats.But, want to know which one is good to use w...
I created a fresh project with a core data template. then I added a employee entity with a firstName string attribute, and populated the persistent store with 100 employees and lots of different first names.
In the RootViewController where the FRC is created, I set the sectionNameKeyPath like this:
NSFetchedResultsController *frc = [[N...
Hi!
I am developing an iPhone App with CoreData. One of my entities has an NSDate property named 'time'. It stores times to the minute/second. As my sections i'd like to have the date to the day. So if there are to entries '2010-06-14 8:00' and '2010-06-14 11:00', i'd like them to be grouped to '2010-06-14'.
Currently I just use @"time...
I mean... could I also just create a plain old UIViewController and then set up a UITableView myself, plus an NSFetchedResultsController?
How much do UITableViewController and NSFetchedResultsController interact with eachother? As far as I see it, UITableViewController is NOT by default already adopting the NSFetchedResultsControllerDel...
Hi all,
I've got a core data-based app for iPhone and I'm getting the following warning:
objc[2472]: Class Property is implemented in both /System/Library/PrivateFrameworks/Notes.framework/Notes and /var/mobile/Applications/B69194FF-448F-48AD-A78D-DDB8935F/AmcCalc.app/AmcCalc. One of the two will be used. Which one is undefined.
When...
So I have a question about the ideal setup for an app I am getting ready to build. The app is basically going to be a memorization tool and I already have an sqlite database full of content that I will be using for the app.
The user will navigate through the contents of the database(using the uipickerview), and select something for mem...
I have an app that builds a slideshow from user images. They can grab from their library or take a picture. I have found that repeated use of grabbing an image from the library is fine. But repeated use of taking a picture causes erratic behavior. I have been getting crashes but mostly what happens seems to be a reloading of the view ...
I have been trying to minimize my memory footprint with UIImagePickerController, but I'm starting to think that the memory problems I am having are resulting from poor memory management, instead of a particular way to handle the UIImagePickerController object.
My workflow is this: The "Edit Image" button is clicked, which presents a UIA...
I have an iPhone application using Core Data with an SQLite database in the bottom. I'm writing some text content from the database to a file, but special characters such as Å, Ä and Ö are corrupted in the file (they show up just fine in the application).
When creating and inserting data, I am not using any special encoding. I'm just ta...
I have a very simple Core Data app which pretty much contains strings of text. I would like to make this text searchable, and can see a "Search Bar and Search Display Controller" object in Interface Builder.
Firstly, would using this Search Bar and Search Display Controller be the best approach for a simple Core Data-driven text search?...
I have a very simple model with two objects: Name and Category. One Name can be in many Categories (it's one way relationship). I'm trying to create 8 Categories every with 8 Names. Example code:
NSMutableArray *localArray = [NSMutableArray arrayWithObjects:
[NSMutableDictionary dictionaryWithOb...
So I've got an .xcdatamodel with about a dozen Entities defined and related to each other, with attributes and so on. So far I've been trying this in to a GUI using NSTableViews to display/enter data, and NSArrayControllers that I instantiate for each entity. This is all working great. They all tie in to the App Delegate's Managed Ob...