core-data

COMPILED Core Data Managed Object Model: Get maximum info from it and its corresponding database

Hi everybody, I am a novice in Objective-C; and I could not find any solution in my Books or internet. My question: What are the most efficient and fastest ways to use already compiled .mom and SQLite db without having the source codes? Details: I am trying to connect my small app to the database of another application and use (read-in...

What is my CoreData fetch request actually returning?

I'm fetching some objects out of a data store but the results aren't what I'm expecting. I'm new to CoreData but I'm fairly certain this should work. What am I missing? Note that User is a valid managed object and that I include its header file in this code, and that UserID is a valid property of that class. NSFetchRequest *request...

Deleting Managed Objects in Background Block

On iPhone, I´ve tried to delete managed objects in background: - (void) cleanUp { dispatch_queue_t queue_cleanUp; queue_cleanUp = dispatch_queue_create("com.aroundcal.cleanup", NULL); dispatch_async(queue_cleanUp, ^{ while (!self.stopThread) { [self deleteMyObjects]; [NSThread sleepFor...

core-data update in live app

Hoping to get some clear advice on this one. I want to push updates to my app when it is live. I plan to do this by modifying the sqlite that ships with the app and then have the app download it. Easy. I haven't worked out how actually get the app to see the new data though.. I can overwrite the sqlite in the documents directory, but t...

Problem rending newline \n in UILabel

Hi all, Got a strange problem here. I am able to get UILabel to render a multiple lines using the following snippet - cell.label.text = @"hihi\nhihi"; But not when I call the same "hihi\nhihi" from Core Data like this - cell.label.text = data.hihi; data.hihi is contains "hihi\nhihi" ...

Illegal relationship between objects in different contexts: but I only have one context?

I get the following error: 'NSInvalidArgumentException', reason: 'Illegal attempt to establish a relationship 'condition' between objects in different contexts when running my iphone app. The relevant part of my model looks like this: AssessmentTree -has one TreeCrown TreeCrown -has one TreeCrownCondition -has one Assessme...

How to use a pre-populated database on a coredata context

Hi all, this is my first question here. Well, I am developing an iPhone application that will use coredata, but the theres not going to be an option to insert data into the database of the app. I want to know how to pre-populate it's database. I thought of creating a plist with all the info and make a function to put it all into the c...

coredata vs file access

Hi, I have 100s of file which needs to be accessed for displaying the content on iphone. They are all plists. Which one is faster core data or file access ? which one is secured ? ...

how to loop through nsfetchedresultcontroller

Hi guys, in my app I need loop through all my entities in Core Data and I'm using NSFetchedresultcontroller. I'm doing it like this at the moment: NSArray *tempArray = [[NSArray alloc] initWithArray:self.fetchedResultsController.fetchedObjects]; for (MyClass *item in tempArray) { // do something } [tempArray release]; tempArray =...

display DetailsViewController using NSFetchedResultController

Hi everyone, In my iphone app I have core data to-many relation topic -->> question, so every topic contains a few questions, I figured out how to display list of topics in UItableView using NSFetchedResultController, but I can't get how shall I construct my FetchedResultController to display questions in chosen topic. I'm trying to fi...

Memory footprint benefits of using CoreData vs in-memory not evident/obvious - opinions?

I have an app that currently holds all state in memory. It fetches a bunch of information from a server as JSON and then holds on to the JSON values in memory. Each JSONObject can be ~300 bytes and there can be thousands of such objects. I use this data simply to populate UITableViews. In order to better handle large amounts of aata, I ...

How can I preload a Core Data database as a part of the build process for an iPhone project?

Here's my situation, and it's probably fairly common but I have yet to find a satisfactory way to do it. I am developing an iPhone application that will have a read-only, pre-loaded Core Data database stored in the app's bundle. I completely understand how to deploy such a thing. That isn't my problem. My problem is How do I pre-load t...

How to uniquely identify nsmangedobject with string?

I'm using Core data and region monitoring. The only way to distinguish between monitored regions is with a NSString for identifier. I'd love to use NSManagedObjectID, but I can't get it to work. What I've tried: NSURL *objURL = [managedObjectID URIRepresentation]; NSError *err; NSString *identifier = [NSString stringWithContentsOfURL:m...

What are faulted entities in Core Data?

Hi guys, What are faulted entities and what the difference between them and 'usual' entities? where can I read about that? Thanks ...

[iPhone dev] NSPredicate with NSDate and repeats (like Calendar app)

Hi, I have an entity "Event" witch contains two properties: date (NSDate) and repeat (NSInteger - 0 = NONE, 1 = DAILY, 2 = WEEKLY, 3 = MONTHLY, ...). Does anyone knows how can I filter events by repeats passing a date ? Example: First event: 01-01-2010 / weekly Second event: 10-02-2010 / monthly Current date: 10-06-2010 Re...

Core data, managed objects and multiple table view controllers

I have a UITabBarController with two tabs.  Each tab has a UINavigationController and each nav controller has a table view.  The first tab lets you see and edit a list of all employees.  The second tab lets you see a subset of the employees.   My problem is that in the first tab you can delete an employee from core data.  However, when y...

core data with pre populated sqlite from csv!!

Hi all, Ive been struggling with this for a couple of days now and after scouring the internet I still havent got it working. I have a csv file, from which I need to populate an sqlite db to use with core data. I thought I had found a solution here http://ablogontech.wordpress.com/2009/07/13/using-a-pre-populated-sqlite-database-with-c...

Commit objects to Database

Hello, I'm having some trouble committing records to the database. When I click a button, I download records from the website, the objects are there in memory and everything works fine but these objects are only committed to core data when I actually close the app. Is there anyway to commit them to core data straight away, without havin...

NSPredicate - returning ever unique instance in a column.

I was wondering if there was a predicate to return every unique instance in a column. ...

set app badge number by rows in table view with core data

Hi all, I'm developing an app that uses Core Data for save and retrieve data. Now I would like to add a badge number on app's icon in the home screen but I have some problems... I tried this code: NSInteger section = [self.tableView numberOfSections]; id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController se...