core-data

NSPredicate: Search on NSNumber (Cocoa)

Hi all, I have an Cocoa Core-Date Application. I added a search field and bound it. Now, I have tried to add some predicates but failed! Here are my two questions: First, the predicate should filter NSNumbers but I cannot build a working predicate. My try: keyPath == [NSNumber numberWithInteger:[$value integerValue]] (keyPath repre...

NSPredicate - Not working as expected.

Hello, I have the following code in place: NSString *mapIDx = @"98"; NSLog(@"map id: %@", mapIDx); NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"WayPoint" inManagedObjectContext:managedObjectContext]; [request setEntity:entity]; //N...

How to have multiple apps - one Core Data?

I’m an experienced developer, but new to Mac. I just don’t want to go down one path only to find out that I made some fundamental error or incorrect assumption later on. I want to ultimately build and sell an iPhone app using Core Data. The app will be free with content available through in-app purchase. Here is what I want to be able ...

NSSecureTextField and NSSecureTextFieldCell examples?

Anyone have NSSecureTextField and NSSecureTextFieldCell examples on a core data based application? Simple log in screen would suffice. Here is an example but it is for an Iphone app. http://www.riccomini.name/Topics/Mobile/iPhone/SimpleLoginScreen/ ...

Count no of boolean records from second table - Coredata

hello my test application can currently load a table view which lists a couple of books, the detailview takes you to cells that displays the book text in cells. the user has the ability to bookmark a cell which is a boolean in the book_text table. what i am trying to do is, on the main table view, is: 1-Load the books like how it does ...

Sharing Non-Persistent Objects Between Contexts in Core Data?

I was wondering if there is a way to share an NSManagedObject between two or more NSManagedObjectContext objects running in the same thread. I have the following problem: I have one main context shared through all my code in the application and several different contexts that are created for each remote fetch request that I issue. (I c...

How to share a piece of Core Data model across iPhone apps?

What's a good pattern, if any, to share a piece of Core Data model across iPhone apps the same way I would share code, images and other resources? I am thinking of developing my model in one app, and then just including it in the other app as a resource. But can't wrap my head around how to do that. Is it sufficient to just include the ...

Core Data leaking strangely on device but not simulator

I've narrowed a memory leak problem down to this specific block of code: NSFetchRequest *req = [NSFetchRequest new]; NSEntityDescription *descr = [NSEntityDescription entityForName:@"Capture" inManagedObjectContext:dataContext]; [req setEntity:descr]; NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"created_at" ascen...

NSManagedObjectContext: autoupdate or not?

Hi everybody, I need to understand something about NSManagedObjectContext update. I have a UISplitView with a UITableViewController on the RootView and a UIViewController on the Detail View. When I tap in a row with data, I load some data into labels and a UITextView where I can update that field: - (void)textViewDidEndEditing:(UITextVi...

NSFetchedResultsController - phantom row

Just run into a tricky NSFetchedResultsController problem. The following code works fine in all cases EXCEPT for the very first entry to the Core Data database when it reports 2 rows! id <NSFetchedResultsSectionInfo> sectionInfo = [[fetchedResultsController sections] objectAtIndex:section]; numberOfRows = [sectionInfo numberOfObjects]...

[iPhone]How would you design Core Data Object Model for the given below structure

JSON As Dictionary { headers = ( { backGroundImageUrl = ""; dataField = Name; headerText = Name; id = Name; itemRenderer = ""; toolTip = ""; width = 60; }, { backGroundImageUrl = ...

How to design Object Graph/Model ?

JSON As Dictionary { headers = ( { backGroundImageUrl = ""; dataField = Name; headerText = Name; id = Name; itemRenderer = ""; toolTip = ""; width = 60; }, { backGroundImageUrl = ""; ...

CoreData: Loading in an Initial Data Set from XML.

I have a plain XCode CoreData enabled iPhone/iPad navigation application. In this I have modifed the data it initially defines to represent some categories in the table view with associated images. For example by modifying a Event to Category elsewhere, changing the .xcdatamodel file and altering this call in RootController.m: - (void...

Core Data cloud sync - need help with logic

Hi, I'm in the middle of brainstorming a cloud sync solution for a Core Data app that I am currently developing. I'm planning to open source the code for this once its done, for anyone to use with their Core Data apps, so input from the community on how this system should work is much appreciated :-) Here's what I'm thinking: Server S...

iPhone - How to select and show a single record in Grouped Table View Format

Im making a iPhone app which includes a list of sports teams. RootViewController lists all the teams in a table view. When I click a row I want to load up a TeamViewController, which just shows the record for a single team. The catch is Im wanting to display that single teams details in the Grouped Table View Style. This is causing m...

Add an instance of NSManagedObject to NSManagedObjectContext ok, updating the same instance failed

I am using core data in my iPhone app. I have created a simple class Friend, which derives from NSManagedObject and which uses the following property: @property (nonatomic, retain) NSString *name; I am able to add and delete instances of this class to my context and my changes are persistent also. Now I want to update/modify a Friend-...

In Objective C why are my core data objects never being deallocated?

I am having a lot of trouble getting m core data objects to be deallocated. I even tried the simplest test I could think of and I watched the retain count and it always seems to be higher than I expect. I also put a breakpoint on the dealloc routine for the core data objects and it doesn't seem to get called (at least not unless I specif...

Using Core data to store objects(pointing to seperate views) in a NSMutableArray .

Hello All, I am new to the iOS. Currently, I am using 3.1.3 base SDK for development and testing. I am developing an application to store credentials. In my Main menu, I have a NSMutable Array with some default cells(objects in NSMutableArray speak) and then the option to add some arrays.Currently I am able to add new cells and remove c...

How to properly handle Core Data save errors wrt user experience on iPhone?

So, I have a basic app for storing, searching, and manipulating data. Basic CRUD operations. In various places of my code where I'm storing or updating this data, I basically have this: NSError *error; if (![self.managedObjectContext save:&error]) { // TODO: Handle this error NSLog(@"Error while saving data %@, %@", error, [error ...

NSTokenFieldCell Subclass to force use of Core Data To-Many Relationship

I have come across an interesting conundrum (of course, I could just being doing something horribly wrong). I would like an NSTokenField to "represent" a relationship in a Core Data Application. The premise is such: You click on a Note from a TableView (loaded from the Notes Array Controller). The token field is then bound (through "val...