I am using Core Data for my iPhone app. My attributes are set with retained properties.
For example, a "number" attribute in a "Thing" entity:
#import <CoreData/CoreData.h>
@interface Thing : NSManagedObject
{
}
@property (nonatomic, retain) NSNumber * number;
@end
@implementation Thing
@dynamic number;
@end
When working with...
Hi all,
I have a NSTableView binded to core data. I have another NSTableView, currently not binded to anything ( but that can change if need be).
When a press a button, I want the currently selected Row in the first table to be copied (but not removed) to the second table.
e.g.
Before:
First Table
Column1 | Column2 | Column3
Person...
I'm passing some NSManagedObject data between two threads using NSOperationQueue with concurrency level to max of 1 and I'd like some suggestions on whether I'm doing this correctly.
Since NSManagedObject is not thread-safe, I'm sending in the NSManagedObjectID from ThreadA (main thread) to ThreadB via an NSOperation derived class. The ...
Hi, is there a way to delete all the records from an NSManagedObjectContext?
I'm using the following code to insert data:
NSManagedObjectContext * context = [[NSApp delegate] managedObjectContext];
NSManagedObject * basket = nil;
basket = [NSEntityDescription insertNewObjectForEntityForName:@"ShoppingBasket"
...
I have the latest version of Xcode and when I select my .xcdatamodel file and then select "Data Model" => "Add Model Version", I get the following dialog:
Internal Error
File: ...
Line: ...
Object: ...
Method: ...
Couldn't create new version 'MyApp1 2.xcdatamodel' in version group 'MyApp1.xcdatamodeld'
=====================
It wiped...
I would like to write a method that deletes my application's Core Data store, which I would follow by creating a new store. Is there a standard approach for doing this, and where is the database located in my application's sandbox?
...
Hello All,
I have a Navigation View with a Table View, when a row is clicked, the row indexPath is passed to the next view.
in the Details view viewDidLoad, i am fetching data from Core Data. i use the fetching from the application delegate
[appDelegate loadItem:i];
As you can see i am passing one integer only which carries the row nu...
I am unsure about the correct definition of transient properties:
One can define transient properties in the object model and then calculate them when needed in the related class.
But things work just as well if you specify a class and define arbitrary getter methods for any transient property without declaring it in the object model (...
Hi there,
I've read the memory management sections in the Core Data docs and I'm still a little confused. I have one context in my app, and I have several things getting objects out of it. For example a few fetched results controllers, detail views and some other code fetching random objects. Once objects have been fully released and th...
I am having an issue with Core Data... here is my situation:
I have a Restaurant and that restaurant has a category which is a to-many relationship and the category also has a to-many relationship back to the restaurants
for example:
McDonald's has a category of: (category) Fast Food, (category) Local
Category (Fast Food)
Type: (NSStr...
I'm a new iPhone developer (of about 4 months or so) who is starting to look at Core Data.
In the "Beginning iPhone 3 Development" book by Dave Mark it mentions that the main difference between fetched properties and relationships is that fetched properties allow lazy loading. However, I have seen other resources and accepted answers o...
Hi all,
Is there a guide to using regular expressions in objective c?
Specifically what to type into the "Reg. Ex." field in a core data property?
In particular, how to limit input to a set amount of numbers/letters only, and for UK Post Codes?
Thanks!
...
Hi,
I have been reading through the core data documentation and feel I am still missing something.
I do not quite understand how you insert objects into a relationship of another object.
For example the following two Entities are in my model
flightDepartureBoard
name:
from_airport:
to_airport:
current_flights: (this is a one to ...
I have a string of data in a plist, which I've got to display, hierarchically like this:
Menu>Chapter>SubChapter>item>item details
This might be super simple, in my initial menu, how would I have all 'All' Menu item to display all the 'items', essentially skipping the chapter and subchapter and cutting out that aspect of my filter, whi...
Hi
Im using a Core Data model for my iPhone app. I have been looking for a way to instantiate or use an Entity outside the ManagedObjectContext. (This should not be done, I know, Im also more looking for a way to not do that, but get the benefits anyway).
My challenge is that I have a view where the user can search for "Persons", all t...
I'm using Core Data for a table view, and I'd like to use the first letter of each of my results as the section header (so I can get the section index on the side). Is there a way to do this with the key path? Something like below, where I use name.firstLetter as the sectionNameKeyPath (unfortunately that doesn't work).
Do I have to gra...
I have three Classes for which I am extending NSManagedObject (I know this isn't required but I wanted the property notation). Theses Classes are QuestionSet, Question and Answer. My data model is setup so that there's a many to many between them like so: QuestionSet <<->> Question <<->> Answer. I load up everything from a server and it ...
Hey Folks,
I'm new to Objective-C, XCode and iPhone development in general and I'm having some issues with Core Data and NSXMLParser.
Having followed Apples' tutorials SeismicXML (for NSXMLParser) and the Core Data on iPhone tutorial I've ran into an issue when assigning values to my Managed Object Models' entities properties.
To expl...
Hello!
Im a budding iphone developer, and doing my best but i have a query regarding the UINavigationController.
I have a tab bar app, with 3 tabs.
The 1st tab has five UIButtons, each loading a different "section" of the app, and each section will have a number of views.
The other tabs simply display some info.
as users select any o...
I'm having some trouble with a recursive relationship in core data. I've got a managed object called a "SearchCategory", and that category can have "Categories" and it can also have a "Category." In the managed object modeler, I've got two relationships set up on the SearchCategory entity, and both point back to the SearchCategory enti...