Hi
I am currently playing with CoreData and have a problem with the CoreDataBooks Example from Apple.
Basically I just wanted to extend the data model. I updated the model class aswell and no compiler error, butr a crash when I want to start the example.
Unresolved error Error Domain=NSCocoaErrorDomain Code=134130 UserInfo=0x1316ce0 "...
I'm missing something here, and feeling like an idiot about it.
I'm using a UIPickerView in my app, and I need to assign the row number to a 32-bit integer attribute for a Core Data object. To do this, I am using this method:
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
...
I am basically trying to implement an achievement tracking setup in my app.
I have a managedObjectModel class called StatTracker to keep track of all sorts of stats and I want my Achievement tracking class to be notified when those stats change so I can check them against a value and see if the user has earned an achievement.
I've tr...
Hi , I am creating a news aggregator application that fetches a xml feed every 4 minutes. After the xml is loaded, I clear everything by deleting all the objects in the database, then save the new objects back into the database. I then call [self.tableViewSection reloadData]; to reload the tableView. Thats when I get a problem. As soon a...
Hi
Ok, after I ran into a dead end modifieing an existing Apple example for CoreData, I started completely new creating my own project and that worked fine,..... until I tried to access a related entity.
So here is what I did.
I created 2 entities, where one is just the detail information of the other one, so there is a one-2-one rela...
Hi all,
I was checking my app for memory leaks using instruments and I got the following NSConcreteMutableData GeneralBlock memory leaks.When I checked it was from the following code.
NSError *error = nil;
if (![[self fetchedResultsController] performFetch:&error]) {
NSLog(@"Failed to load data : %@", [error localizedDescript...
I've got a relatively complicated Core Data relationship structure and I'm trying to figure out how to set up value dependencies (or observations) across various to-many relationships. Let me start out with some basic info. I've got a classroom with students, assignments, and grades (students X assignments). For simplicity's sake, we ...
Hi
I have a simple problem, I have an app based on CoreData and I need to change the structure a little. How can I migrate the old structure into the new one. Just adding one attribute will chrash the whole app.
Thanks
...
My entity has a property (sortOrder) that is of the type Decimal(NSDecimalNumber) but when I execute a fetch request using that property as a key, I get back results in a seemingly random order. If I output the value of the property I get really strange values until I get it's intValue.
Example: The first run produces this result. Th...
Hello,
I'm starting with CoreData and I have a question :
I have an array with NSNumber objects in it. I need to create an entity Event for each object with only one attribute eventNumber which should also be an NSNumber.
Can I pass the object of my array like this :
for (int i = 0, i<[myArray count], i++){
Event *newEvent = [NSEnt...
Hi,
I am trying to store a PNG image in a core data store backed by an sqlite database. Since I intend to use this database on an iPhone I can't store NSImage objects directly. I wanted to use bindings and an NSValueTransformer subclass to handle the transcoding from the NSImage (obtained by an Image well on my GUI) to an NSData contain...
I have a fairly simply schema. Essentially, Run <--> Data (where a Run holds a data, e.g., Temperature, sampled from some sort of sensor).
Now, it seems that sensors can have more than one measurement (e.g., Temperature and Humidity). So, a single Run could have multiple data samples.
Hence, Run <-->> Sample and Sample <--> Data. (And...
I am using core data for my app and I never had any problems adding or removing columns until recently. But now even if I make changes to my xcdatamodel and generate new and updated entity h/m files, sqlite doesn't seem to be picking up the changes. I actually went over to the documents folder and inspected the create statement for th...
Hi all,
In my app I want to load some initial data to show the user how it works. The app uses a CoreData managed sqllite db.
SO far I've thought of 3 options:
Write code into a class to programmatically create the data.
Create a xml file in the apps resources and load through a NSXmlParser whose delegate creates the entries in the ...
I have two tableviews where one navigates to the next. Both use more or less the same code and use the managedObjectContext and FetchedResultsController design pattern to provide the relevant data for both tables.
My problem happens when I navigate from the first to the second tableview and when the datasource has only one Section Head...
I am just learning Core Data on iPhone and the tutorial I am following says to create a new file and select NSManagedObject as the template. However, in Xcode 3.2.2 it seems to be gone. Is there any way to get it back or some kind of workaround?
Thanks in advance!
...
I'm writing Coredata document-based application (i.e. CoreData+NSPersistentDocument): as I create a new document, a new coredata stack is initialized, with a model and a single managed context.
Before the user saves the document, what I need to do is:
- create a new context
- create many new managed objects in it
- merge the two context...
I am trying to create an application which allows background threads to update core data objects while the user might be reading the same data.
My approach to this would be to use multiple NSManagedObjectContexts and then before a background thread does a -save: operation, I fetch the object the user is currently working on and fire the...
Hello,
I've always created my NSFetchRequests entirely in-code. Now I'm looking at the Xcode GUI for building a fetch request and storing it in the model.
I'm following an example from the Xcode Documentation. I added a Fetch Request to my model, and the predicate that has been created through the Modelling GUI is:
firstName LIKE[c]...
I've this simple Core Data Model:
Question, Answer
Every every question has 4 answers.
The code is the following:
Question.m
@interface Question : NSManagedObject
{
}
@property (nonatomic, retain) NSString * questionText;
@property (nonatomic, retain) NSSet* answers;
@property (nonatomic, retain) Package * package;
@end
@inte...