core-data

Tab Bar Application, ManagedObjectContext

hi, I have this tab bar application, I have 1 tab setup correctly with a drill down navigation/table view controller which display information and details of Entity A ; And now I want to create a new tab which display another set of drill down and displaying information of Entity B which both entity has no relations. I tried to use ...

Crash on creating new persistence store (jailbroken iPhone device 4.1)

Hi there, Whenever I deploy "CoreDataBooks" Apple iOS sample application to my jailbroken device with self signed certificate and run it - it crashes at line where core-data persistent store is added to persistent store coordinator: line 178: if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:n...

Display CoreData Records

Hi, I create an application using Coredata. I create a XML file and store all data into XML file. Then using coredata i store them into Database. Now i want to view the all records from core data. My application create a sqlite file. But if i use select command in sqlite, there is no records displayed. But It shows "no errors". If ther...

keeping track of accessed objects in CoreData via objectID?

I want to have table in CoreData that holds a list of other CoreData objects I have accessed, for instance I have Clients and I want a table RecentClients that is simply holding this list and the date they were accessed. Can I store the objectID and then do a fetch request based on that? EDIT: See Ben's answer below and then go here: h...

Strange Core Data Crash

I am experiencing a strange crash that is related to setting properties (typically bools) for a NSManagedObject. The method that this code is being run on is on a background thread. It is being called from a [NSURLConnection connectionDidFinishLoading] delegate method. Here is the code. { // Create a new MOC because we are working on...

restrict delete of a referenced managedobject

I have a simple Core Data model: Entity Team (name, logo) Entity Sport (name, teams to->many Teams) So, a Sport can have many Teams I create the Team first, then add or edit a Sport and add the Teams. If I delete a Team, my app starts crashing. I believe because it is looking for the deleted reference. So, how can I restrict via Core...

iOS core data corruption?

Hi guys, This is a rather general question, as I don't have any solid evidence atm. I have an iPhone app with about 20,000 users. It allows users to message each other, and saves those messages in core data. The only other thing it saves in core data is the users profile, a copy locally and a copy on the server. I have a small perce...

Objective-C Core Data: Access data from child of child

I'm slowly figuring out Core Data for my iPad app, but I just can't seem to figure out how to access data from my to-many children (who also have to-many children). I'm hoping to get some code examples from the experts here. Let's use a simple data structure: Parent -(to many)-> Child -(to many)-> Toy I can fetch the Parent just fine ...

Get image paths from NSBundle in Objective C?

I have about 60 images I want to store in Core Data, 30 of which are avatars and have the prefix of avt_filename_00X.png and 30 of them are smaller and have a different prefix. Rather than storing all the images as BLOBs in Core Data/SQLite, I want to store the paths for each image found (in the same way you would store image paths for ...

CoreData: Crash purging caches after a Memory warning

I've got a stack trace showing a crash responding to a memory warning: Thu Oct 28 00:42:55 iPhone DTMobileIS[10853] : _memoryNotification : {name = (null), num = 1} Thu Oct 28 00:42:55 iPhone DTMobileIS[10853] : _memoryNotification : { OSMemoryNotificationLevel = 1; timestamp = "2010-10-28 07:42:55 GMT"; } Thu O...

Tips for simplifying UI with large data model?

Hello, I'm working on an app for iPhone, and the data model looks a little crazy - 16 entity types. Could you offer any advice for masking complexity like this from the user? I know all these need to be there, but I'm trying to make it look simple, cause otherwise people will not understand. The Tricks I have figured out so far: My ap...

SQLite3: Batch Insert?

Hi everyone. I've got some old code on a project I'm taking over. One of my first tasks is to reduce the final size of the app binary. Since the contents include a lot of text files (around 10.000 of them), my first thought was to create a database containing them all. I'm not really used to SQLite and Core Data, so I've got basically ...

to get all the values in a field using coredata

I have an entity ("Settings") and I want to get all the values in just one field ("Status").I am using coredata. Can anyone plz help me? ...

Dynamic properties in Core Data

Hi All, I am new to ObjC and newer still to CoreData. I have tried to find an answer to this around but never got quite what happens to me. I initialize a Managed object in my controller's loadView like this: NSError *error; NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescript...

Store cache images

I'm looking for the best read performance for a bunch (~200) cached 80px by 80px images. A large chuck (~50) will all needed to be accessed at once. Should I store the uiimages (as binary data) in a plist or using core data? ...

iOS Core Data how can it leak?

Hello I was analyzing my app with leaks, and i observe that some core data entity is leaking, how can a NSManagedObject leak? I thought it was managed by the operating system? Are there known leaks in core data? The line that Leaks says causes the leak is NSMutableArray *e=[NSMutableArray arrayWithArray:[[user videos] allObjects]]; ...

Animating Row Deletion in UITableView with CoreData gives Assertion failure

Hi all. I have a UITableView that shows a list of objects stored with CoreData. I can delete an object using the following code: - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { ...

What is the default latitude & longitude on iPhone?

I want these double values to seed/pre-populate an sqlite file. Thanks! Matt ...

Core Data or Sqlite in my Project?

I'm trying to develop one iPhone App like the Recipes example of Apple, but I have one question? I want to show data that I have stored in a database, but I don't want user to add data or edit this information. I only want to show the data in a table view like name, description, image, etc. What's the best option? Core Data (and how I ad...

XCode 4 Generating classes from entities in CoreData

Hi guys, Im using XCode 4 and working with CoreData. Now, how do I generate classes for entities? I used to do it in XCode 3 by clicking on a diagram entity, going to File->New and choosing NSManagedObject class. For some reason i cant seem to find it in XCode 4, it's not showing up in the dialog... ...