Core Data Document Icon

Hey guys,
I have a document based Core Data application here. When I save a file as Binary/XML I get a standard blank file icon. How do I make sure the user sees a custom icon when saved from my app?
TIA,
Ricky.

rickydamelio wrote:
I have a document based Core Data application here. When I save a file as Binary/XML I get a standard blank file icon. How do I make sure the user sees a custom icon when saved from my app?
You do this for a Core Data app just like you would for any other Cocoa application. And with a core data app most of the details should already be set up for you.
Check out Storing Document Types Information in the Application's Property List for more info.
First you need to create a .icns file containing the icon you want to use for your document. Then add the icns file to the Resources group of your Xcode project so when you build it will get copied into your application bundle. You can create a different .icns file for each type of document, or you can use the same icon file for all your document types if you want them to have the same icon.
Next, expand the "Targets" group in Xcode, select your target and click the "Info" button in the toolbar. Select the "Properties" tab of the Info window. A core data app should already have three document types set up in the list at the bottom the window. Edit the "Icon File" column and add the file name of your .icns file for each document type.
You may want to edit the "Name" column as well. Whatever you put here is what will show up as the "Kind" in the preview column if you select one of your documents in column view or if you do a "Get Info" on one of your documents.
You can also change the "Extensions" column and the "OS Types" column to uniquely associate your documents with your application. But note that if you change these values then your application may have trouble opening _pre-existing documents_ that were created with the original extensions or types. You could manually rename an existing document to remove the old extension and add the new one. Or use the SetFile tool if you needed to change an pre-existing document's OS Type.
The Finder probably won't pick up on these changes right away. You may have to logoff and log back on or force Finder to restart before your changes will be recognized.
Steve

Similar Messages

  • How to implement parent entity for core data

    Hi there.
    I am starting a document-based Core Data application (Cocoa) and developed the following data model;
    The 'invoice' entity is a parent entity of 'items', because ideally I would want there to be many items for each invoice. I guess my first point here is - is what I am trying to do going to be achieved using this method?
    If so, I have been trying several ways in Interface Builder to sort out how to implement this structure with cocoa bindings. I have made a Core Data app before, just with one entity. So this time, I have two separate instances of NSArrayController's connected to tables with relevant columns. I can add new 'invoice' entities fine, but I can't get corresponding 'items' to add.
    I tried setting the Managed Object Context of the 'item' NSArrayController to this;
    I thought this would resolve the issue, but I still have found no resolution to the problem.
    If anyone done something similar to this, I'd appreciate any help
    Thanks in advance,
    Ricky.

    Second, when you create a Core Data Document Based application, XCode generates the MyDocument class, derivating from NSPersistentDocument. This class is dedicated to maintain the Managed Object Model and the Managed Object Context of each document of your application.
    There is only one Context and generally one Model for each Document.
    In Interface Builder, the Managed Object Context must be bound to the managedObjectContext of the MyDocument instance: it's the File's owner of the myDocument.xib Nib file.
    It's not the case in your Nib File where the Managed Object Context is bound to the invoiceID of the Invoice Controller.
    It's difficult to help you without an overall knowledge of your application, perhaps could you create an InvoiceItem Controller and bind its Content Set to the relationship of your invoice.

  • Simple core data problem--- please help

    hi all,
    I've done a few core data tutorials, can't say I understand all the switches and doodads, but I'm fairly comfortable with it. I can create almost any kind of "to many" relationship work, and its pure magic...
    the problem is that every "to one" relationship fails to work. I would have thought this was easy! but its apparently impossible.
    heres how to get exactly were i am:
    1. make a new xcode project... core data document based application.
    2. in the model graph make 1 entity with 1 attribute, say an int16 for arguments sake... it doesn't matter what it is the results are always the same.
    3. open up your myDocument.nib file in IB
    4. switch back to xcode, leaving the main window of you Doc visible.
    5. option click + drag your entity from the model graph in xcode, to the main window in IB (you'll see a green plus symbol if its working) and release it
    6. select one object from the resulting option window.
    7. save all files, compile the app, and run it.
    you will now see a control (usually a text box) that is grayed out, and reporting: "no selection". if we had picked "many objects" in #6, this app would be working. so what gives?
    well in the bindings, the item labeled "Controller Key" is set to "selection" and I guess that since there is just the one object, and were already bound to it, theres No need for a selection, thus breaking the binding. But what options do we have in that list? nothing that makes sense, and even though we can put in whatever we feel like, nothing makes any sense. And why would apple even bother letting you drag n drop an entity if it wasn't set up correct in the first place anyway?
    whats going on here? the docs and the tutorials all focus on repeating things I already know, none of them illuminate what the Controller Key is really looking at, and what I need to put in that box to make it aware that it doesn't have a selection, just attributes.

    ok.
    here is whats really happening...
    i set everything up correctly, but when we go to runtime, there is no instantiation of any data, at all. I have a controller, but it has nothing to control.
    with the "to many" relationships, you get an empty table, with add, remove buttons. So its the standard behavior to assume that you don't need the data in the beginning, leading me to a logistical problem, but one that I understand enough to begin formulating a plan.
    I can make a call that instantiates an instance of the data, from my document object, in the awake from nib method. which call? who knows. But I seem to recall that there is some sort of bug in the display anyway, so it may be more complicated than that.

  • Core Data question

    Hi all,
    I'm hitting a wall trying to figure out how to do this, so hopefully someone can point me in the right direction... I'm also a bit new to Cocoa/Obj-c programming so hopefully this isn't too obvious
    I'm building a core data document based app and have my data model designed but I realized that quite a bit of the data should be separate and shared across all documents created in the app. I'd think the easiest way would be to put those entities in a separate data store and load it concurrently in any open documents, but have it be part of the base data model. I'll try to clarify what I'm getting at:
    The user can have multiple documents, and possibly multiple open at any given time, and I'll try to use a simplified example
    The entities for this application are
    Project
    ExpenseLog
    ExpenseLineItem
    Categories
    Vendors
    The relationships are
    ExpenseLog <--->> ExpenseLineItem
    ExpenseLog <<---> Vendors
    ExpenseLineItem <<---> Categories
    Each project gets it's own file, and the application is tracking expenses (think of an ExpenseLog row as an invoice.) Most projects will have common categories and common vendors, but the ExpenseLog is unique to the project. If a user adds a vendor or category to a project, it should add it to the Vendors or Categories entity and be available across all other projects.
    From what I was able to find so far, there should be a way to do this, but I have yet to find any detail on how... The second question I have, is that for an application like this would it be better (definitely easier, but better in terms of user experience) to just have a single document that contains all projects and set up a Project <-->>ExpenseLog relationship?
    thanks!

    Hrm, let me try to rephrase this and see if I can make it clearer...
    The application is a core data document based one. The idea is that there is some data that is common to all documents, and some that is unique. I'd like to store the common data in one file that is loaded and accessable across all open documents, and the unique data in each documents own file.
    If I open expenselog1 and expenselog2 both documents should have the same list of vendors and categories. If I add a vendor to expenselog1, it should become available in expenselog2 and vice versa. If I open a new document, expenselog3 it should also see all of the above vendors and categories. If I add an entry to expenselog1, it should only be added to that document and saved in it's own file.
    I've found some stuff on entity configurations, but apples documentation (at least what I've found so far) has little substance on this point and contains circular references (i.e. car: see automobile, automobile: see car) Also, it states that you can not create cross store relationships. Is the idea that you put an entity into multiple configurations and then if the entity is updated, both configurations are also updated? Or do you have to write code that updates both configurations discretely? Also, all the references I have found so far say to set the configuration for an entity, but it doesn't say how to configure the configuration to access a particular store.
    What I'd like is that there is a common file that contains the common entities and a separate file that contains the individual documents so that the documents have access to the common elements.
    Thanks.

  • Core Data errors when loading saved files

    Hi there.
    I am working on a fairly simple Core Data document-based application that I am working on. Some files have been previously saved (in the same version of the app) using the SQLite and XML file types, but now cannot be reopened.
    The following error appears in the application;
    {quote}"The document “Test” could not be opened. The file isn’t in the correct format. The file might be corrupted, truncated, or in an unexpected format."{quote}
    The files themselves only have some text in them, and that is all.
    Does anyone know of a reason why these files cannot be reopened after saving them?
    Thanks in advance,
    Ricky.

    Does anyone know of a reason why these files cannot be reopened after saving them?
    Did you check to see if the file type/suffix was modified or perhaps added and then made invisible. Example: 'myfile.sql.txt' - do a get info, show suffix and double check that what you see is what you want. Also check permissions while you're there.
    If that fails, go to your backups and be careful how you modify your dbs in the future...don't just whack them with a text editor, etc.

  • Web Template with document icon in result row

    Hi All,
    I have a web template created in WAD 7.0.
    It has Analysis item with a Query as dataprovider.I have checked the "Document Icons for Data" to On in the cell content section of Analysis Item.
    In query property also,Document link for infoprovider option is checked.
    It is displaying the document icon in data cells correctly wherever comment is entered.But it also displays document icon in the result row cells.
    I do not want to display the document icon in the result row cells.
    Please help in this regard.
    Thanks.

    Have you considered creating and using query views?

  • Best practice for core data managed objects

    Hello
    I'd like to konw if there is a document available listing the good practices when managing core data managed objects.
    For example should I keep those objects in memory in a singleton class, or save thme to the DB and load them when needed, ... I am trying to figure out how to manage Annotation views representing managed objects when using the MapKit.
    Thanks

    Seen this?
    Using Managed Objects

  • Should I use Core Data?

    I'm starting a new document-based application. Is Core Data the way of the future, or just a convenience for specific types of apps? That is, in the "old days" you would override -[NSDocument dataOfType:] and readFromData: to archive your objects. It seems appealing to use Core Data and get automatic archiving in XML, SQL, and binary all for free, but the tutorials I've gone through all seem directed at a very different kind of app than mine. (Rather database-like, but I suppose the demo has to look like something.) The old "Sketch" example, which uses old-style archiving, hasn't been updated in years. Which direction to go?

    Look up HyperCard in Wikipedia for a good explanation. In short, I'm developing a GUI-based mini-app environment, where users can create buttons & fields, and hook them up with an elementary scripting language. I've written the compiler & interpreter, am starting the surrounding framework.
    "Have you looked at the Apple HIGs lately?" Dude, I was reading "Inside Macintosh" back in 1984.
    Mobile platform? Since I'm using garbage collection, I'm shut out of iPhone/iPad, at least for the time being.

  • Info.plist issues with Core Data

    I created a new project, selecting to use Core Data. However, the info.plist does not include the standard iPhone project options like status bar style and icon gloss etc. I tried copying and pasting the status bar style key and value from another project's plist, but this has no effect.
    Any help would be appreciated please.

    Verduomo wrote:
    I created a new project, selecting to use Core Data. However, the info.plist does not include the standard iPhone project options like status bar style and icon gloss etc.
    Shine is added by Apple now. I get shine without a 'prerendered' key.
    What SDK are you working with?
    Did you add a 'prerendered' key?
    <key>UIPrerenderedIcon</key>
    <true/>

  • Core data refuses to work

    hi.
    I have a very simple model, it contains 1 entity with 4 attributes.
    I have created an ObjectController in IB, and bound it to my persistent document's object context.
    I follow this code (found in the core data documentation)to get a reference to the Object, and to set/get values:
    NSManagedObject *myDoc = [NSEntityDescription insertNewObjectForEntityForName:@"BKSketchDocMO" inManagedObjectContext:[dataSource managedObjectContext]];
    thePanX = [[myDoc valueForKey:@"docPanX"] floatValue];
    [myDoc setValue:[NSNumber numberWithFloat:[self bounds].size.width/2] forKey:@"docPanX"];
    now we come to the problem.
    its doesn't work. theres an entity. I can get a reference to it, and it ALWAYS has the default values. NOTHING i do changes the values, NOTHING i do gives me anything Except the default values.
    and since core data is basically a black box... I CAN"T DEBUG IT.
    can anyone, shed any light on anything that might explain why I can get the object, get values, but I cannot set values?
    signed,
    getting frustrated by the core data double-talk and general lack of any real, and useful documentation.
    Message was edited by: Edward Devlin1

    Hi kids, yet again I have answered my own question. in my application, I could not make my object graph self populate, and then when i did get it to populate programatically, I could not access the data.
    I have solved both problems. one was a conceptual problem, and the other was operator error building off of a conceptual problem.
    first, lets tackle why my object graph doesn't auto populate. in IB i made an Object controller, and I hooked it up to my entity. I told the controller to automatically prepare content. I had assumed that it meant that when my Object Context was instantiated, it would automatically create an instance of my referenced object. this is Not how core data works. Currently i am working under the impression that "automatically prepares content" mean that when an entity is instantiated, it will fill out the appropriate values, with the defaults you set up in your object model.
    so core data Does not actually instantiate anything for you. once I made this conceptual leap, I was still hazy on the implementation. I tried adding new entities upon initialization, but that tended to over-write entities opened from a saved document. in the end, I simply settled on making sure the entity existed when i tried to access its information. If it didn't exist I made one before trying to access it. in practice, this is a very slick and robust solution.
    now for problem #2... every time I tried to access my data, it is like it was zeroed out to the default settings.
    well, thats exactly what was happening. my entity was valid, I was making changes to it, and I was still getting the default values back. How was this happening? I didn't understand what i was doing.
    heres what I thought was happening. I thought I was making a new ManagedObject, and filling it with the values of the entity I was trying to access, then I got the values from that ManagedObject, and discarded it.
    What was really happening: If you look at my code, you'll see a method called : "insertNewObjectForEntityForName:" this is the method I THOUGHT was going to my ObjectContext, getting my entity and creating a ManagedObject from it for me to interface with. Clever coders will see the problem right away. Insert new Object? I was creating a new instance of my entity each time i Thought I was accessing the original. holy crap! of course I was only getting the default values... and sure I was able to make a change to the values, but the next time I tried to access them, I would just get a new entity, filled with default values!
    so InsertNewObject, was the wrong approach... what turned out to be the correct approach? heres why i was having such a bad time of this... NSDictionary, is roughly analogous to Core Data. I have alot of experience w/ NSDictionary, and so i expected a straight forward... give me an object based on this key method. I understood that i was going to have to work through a proxy, but I had assumed a little too much about how Core data works. its not like NSDictionary at all. it works much more like a search engine... you tell it where, and what to look for and it will bring you back a list of things that are kinda like what you're looking for.
    This is called a fetch request. Its a much more elaborate way to look for stuff than a simple objectForKey: method. its how you get your information from core data. Information comes back as an array of NSManagedObjects. The documentation made everything so much more difficult because it spoke of fetched values as something extra or added on to core data. Kids say it along w/ me.... fetch requests are how you get info from core data. repeat.

  • Core data warehouse-component in SAP BW

    Hi experts,
    a typical data warehouse reference architecture (as described in many books) basically consists of a core data warehouse, an ods and data marts.
    As far as I understood in SAP BW an ODS object acts as a storage location for consolidated and cleaned-up transaction data (transaction data or master data, for example) on the document (atomic) level. This data is not stored permanently but overritten as soon as changes are applied to data in the operational systems.
    But where in SAP BW is a component like a core data warehouse that stores consolidated and cleaned-up transaction data on atomic level permanently without overwriting it????
    Thanx
    Axel

    hi Dinesh
    thanx for the PDF! Does it refer to SAP BW 3.5 or NW2004?
    Do I get it right that in SAP BW version 3.5 there is no "core data warehouse" that provides persistent historic data on a granular level but only ODS-Objects that can only provide the latest integrated but NOT HISTORIC data on a granular level?
    And do they actually introduce a new component in NW2004 (referring to page 20 in PDF) or only suggest a differnt way of modelling a set of ODS-Objects and InfoCubes (that have already existed in version 3.5) with granular data to a "Data Warehouse Layer"?
    Thanx
    Axel
    22 von 38

  • Core Data and Xcode 4

    It seems as if there are some very important parts of the Core Data data model editor missing, namely setting up "To Many" relationships, and setting the deletion rules.
    Where do you do this in Xcode 4?

    nevermind, I've found it. For anyone else looking, you must have the Utility View open (the left-side view from the top bar), And have it set to "Show Data Model Inspector" (on my screen, the 3rd of the top icons on the utility view)
    Kinda frustrating that it's so hidden...

  • Core data binding not working

    in my project I used core data and binding to produce data on document based program.
    I have used multiple entities and they worked fine and then they stopped working and I don't know why.
    all the text fields now have "()" in them with space in between them, and will not add to the database.  so the field shows a junk value and will not bind properly to the database.
    how would I start to debug this I have been searching but I don't know where to start, mainly i dont know what the problem is.

    Binding works one way. This means that textInput.text changes
    to match the value of account.identifier, not the other way around.
    While I think it's theoretically possible to create a binding the
    other way (I haven't played with binding in ActionScript), it makes
    more sense to listen to the TextInput's change event to get changes
    to the text field.
    Or, you can create a model in the MXML and bind one its
    properties to the textinput's value. Look in the docs about the
    mx:Model tag for details.

  • End user document Icon

    Hi
      I want to attach an end user document icon just beside one parameter.Is there any funtion module to do it.

    Hi Praveen
    Copy the below code to a temporary program and test:
    Code:
    selection-screen: begin of line.
      selection-screen comment (10) text-001 for field p_date.
      parameters: p_date type datum.
      selection-screen position: 30.
      parameters: p_info type c no-display.
      selection-screen comment (10) text-002 for field p_info.
    selection-screen: end of line.
    Now define Text-Elements as below:
    TEXT-001 -> Date
    TEXT-002 -> @0S@
    Generate the code and execute to find the selection-screen with the INFO icon.
    Hope this helps...
    Kind Regards
    Eswar

  • IPhone core data - fetched managed objects not being autoreleased on device (fine on simulator)

    I'm currently struggling with a core data issue with my app that defies (my) logic. I'm sure I'm doing something wrong but can't see what. I am doing a basic executeFetchRequest on my core data entity, but the array of managed objects returned never seems to be released ONLY when I run it on the iPhone, under the simulator it works exactly as expected. This is despite using an NSAutoreleasePool to ensure the memory footprint is minimised. I have also checked with Instruments and there are no leaks, just ever increasing allocations of memory (by '[NSManagedObject(_PFDynamicAccessorsAndPropertySupport) allocWithEntity:]'). In my actual app this eventually leads to a didReceiveMemoryWarning call. I have produced a minimal program that reproduces the problem below. I have tried various things such as faulting all the objects before draining the pool, but with no joy. If I provide an NSError pointer to the fetch no error is returned. There are no background threads running.
    +(natural_t) get_free_memory {
        mach_port_t host_port;
        mach_msg_type_number_t host_size;
        vm_size_t pagesize;
        host_port = mach_host_self();
        host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t);
        host_page_size(host_port, &pagesize);
        vm_statistics_data_t vm_stat;
        if (host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size) != KERN_SUCCESS) {
            NSLog(@"Failed to fetch vm statistics");
            return 0;
        /* Stats in bytes */
        natural_t mem_free = vm_stat.free_count * pagesize;
        return mem_free;
    - (void)viewDidLoad
        [super viewDidLoad];
        // Set up the edit and add buttons.
        self.navigationItem.leftBarButtonItem = self.editButtonItem;
        UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject)];
        self.navigationItem.rightBarButtonItem = addButton;
        [addButton release];
        // Obtain the Managed Object Context
        NSManagedObjectContext *context = [(id)[[UIApplication sharedApplication] delegate] managedObjectContext];
        // Check the free memory before we start
        NSLog(@"INITIAL FREEMEM: %d", [RootViewController get_free_memory]);
        // Loop around a few times
        for(int i=0; i<20; i++) {
            // Create an autorelease pool just for this loop
            NSAutoreleasePool *looppool = [[NSAutoreleasePool alloc] init];
            // Check the free memory each time around the loop
            NSLog(@"FREEMEM: %d", [RootViewController get_free_memory]);
            // Create a minimal request
            NSEntityDescription *entityDescription = [NSEntityDescription                                                 
                                                  entityForName:@"TestEntity" inManagedObjectContext:context];
            // 'request' released after fetch to minimise use of autorelease pool       
            NSFetchRequest *request = [[NSFetchRequest alloc] init];
            [request setEntity:entityDescription];
            // Perform the fetch
            NSArray *array = [context executeFetchRequest:request error:nil];       
            [request release];
            // Drain the pool - should release the fetched managed objects?
            [looppool drain];
        // Check the free menory at the end
        NSLog(@"FINAL FREEMEM: %d", [RootViewController get_free_memory]);
    When I run the above on the simulator I get the following output (which looks reasonable to me):
    2011-06-06 09:50:28.123 renniksoft[937:207] INITIAL FREEMEM: 14782464
    2011-06-06 09:50:28.128 renniksoft[937:207] FREEMEM: 14807040
    2011-06-06 09:50:28.135 renniksoft[937:207] FREEMEM: 14831616
    2011-06-06 09:50:28.139 renniksoft[937:207] FREEMEM: 14852096
    2011-06-06 09:50:28.142 renniksoft[937:207] FREEMEM: 14872576
    2011-06-06 09:50:28.146 renniksoft[937:207] FREEMEM: 14897152
    2011-06-06 09:50:28.149 renniksoft[937:207] FREEMEM: 14917632
    2011-06-06 09:50:28.153 renniksoft[937:207] FREEMEM: 14938112
    2011-06-06 09:50:28.158 renniksoft[937:207] FREEMEM: 14962688
    2011-06-06 09:50:28.161 renniksoft[937:207] FREEMEM: 14983168
    2011-06-06 09:50:28.165 renniksoft[937:207] FREEMEM: 14741504
    2011-06-06 09:50:28.168 renniksoft[937:207] FREEMEM: 14770176
    2011-06-06 09:50:28.174 renniksoft[937:207] FREEMEM: 14790656
    2011-06-06 09:50:28.177 renniksoft[937:207] FREEMEM: 14811136
    2011-06-06 09:50:28.182 renniksoft[937:207] FREEMEM: 14831616
    2011-06-06 09:50:28.186 renniksoft[937:207] FREEMEM: 14589952
    2011-06-06 09:50:28.189 renniksoft[937:207] FREEMEM: 14610432
    2011-06-06 09:50:28.192 renniksoft[937:207] FREEMEM: 14630912
    2011-06-06 09:50:28.194 renniksoft[937:207] FREEMEM: 14651392
    2011-06-06 09:50:28.197 renniksoft[937:207] FREEMEM: 14671872
    2011-06-06 09:50:28.200 renniksoft[937:207] FREEMEM: 14692352
    2011-06-06 09:50:28.203 renniksoft[937:207] FINAL FREEMEM: 14716928
    However, when I run it on an actual iPhone 4 (4.3.3) I get the following result:
    2011-06-06 09:55:54.341 renniksoft[4727:707] INITIAL FREEMEM: 267927552
    2011-06-06 09:55:54.348 renniksoft[4727:707] FREEMEM: 267952128
    2011-06-06 09:55:54.702 renniksoft[4727:707] FREEMEM: 265818112
    2011-06-06 09:55:55.214 renniksoft[4727:707] FREEMEM: 265355264
    2011-06-06 09:55:55.714 renniksoft[4727:707] FREEMEM: 264892416
    2011-06-06 09:55:56.215 renniksoft[4727:707] FREEMEM: 264441856
    2011-06-06 09:55:56.713 renniksoft[4727:707] FREEMEM: 263979008
    2011-06-06 09:55:57.226 renniksoft[4727:707] FREEMEM: 264089600
    2011-06-06 09:55:57.721 renniksoft[4727:707] FREEMEM: 263630848
    2011-06-06 09:55:58.226 renniksoft[4727:707] FREEMEM: 263168000
    2011-06-06 09:55:58.726 renniksoft[4727:707] FREEMEM: 262705152
    2011-06-06 09:55:59.242 renniksoft[4727:707] FREEMEM: 262852608
    2011-06-06 09:55:59.737 renniksoft[4727:707] FREEMEM: 262389760
    2011-06-06 09:56:00.243 renniksoft[4727:707] FREEMEM: 261931008
    2011-06-06 09:56:00.751 renniksoft[4727:707] FREEMEM: 261992448
    2011-06-06 09:56:01.280 renniksoft[4727:707] FREEMEM: 261574656
    2011-06-06 09:56:01.774 renniksoft[4727:707] FREEMEM: 261148672
    2011-06-06 09:56:02.290 renniksoft[4727:707] FREEMEM: 260755456
    2011-06-06 09:56:02.820 renniksoft[4727:707] FREEMEM: 260837376
    2011-06-06 09:56:03.334 renniksoft[4727:707] FREEMEM: 260395008
    2011-06-06 09:56:03.825 renniksoft[4727:707] FREEMEM: 259932160
    2011-06-06 09:56:04.346 renniksoft[4727:707] FINAL FREEMEM: 259555328
    The amount of free memory reduces each time round the loop in proportion to the managed objects I fetch e.g. if I fetch twice as many objects then the free memory reduces twice as quickly - so I'm pretty confident it is the managed objects that are not being released. Note that the entities that are being fetched are very basic, just two attributes, a string and a 16 bit integer. There are 1000 of them being fetched in the examples above. The code I used to generate them is as follows:
    // Create test entities
    for(int i=0; i<1000; i++) {
        id entity = [NSEntityDescription insertNewObjectForEntityForName:@"TestEntity" inManagedObjectContext:context];
        [entity setValue:[NSString stringWithFormat:@"%d",i] forKey:@"name"];
        [entity setValue:[NSNumber numberWithInt:i] forKey:@"value"];
    if (![context save:nil]) {
        NSLog(@"Couldn't save");
    If anyone can explain to me what is going on I'd be very grateful! This issue is the only only one holding up the release of my app. It works beautifully on the simulator!!
    Please let me know if there's any more info I can supply.

    Update: I modified the above code so that the fetch (and looppool etc.) take place when a timer fires. This means that the fetches aren't blocked in viewDidLoad.
    The result of this is that the issue happens exactly as before, but the applicationDidReceiveMemoryWarning is fired as expected:
    2011-06-08 09:54:21.024 renniksoft[5993:707] FREEMEM: 6131712
    2011-06-08 09:54:22.922 renniksoft[5993:707] Received memory warning. Level=2
    2011-06-08 09:54:22.926 renniksoft[5993:707] applicationDidReceiveMemoryWarning
    2011-06-08 09:54:22.929 renniksoft[5993:707] FREEMEM: 5615616
    2011-06-08 09:54:22.932 renniksoft[5993:707] didReceiveMemoryWarning
    2011-06-08 09:54:22.935 renniksoft[5993:707] FREEMEM: 5656576

Maybe you are looking for

  • Problem on degital sign the PDF document i.e ROC forms

    For additional help, reach us at http://helpx.adobe.com/contact.html General Info Chat start time Jan 6, 2015 10:06:03 PM PST Chat end time Jan 6, 2015 10:14:00 PM PST Duration (actual chatting time) 00:07:57 Operator Imran Chat Transcript info: Than

  • F&R Stock considered for FRP is 0

    Hi all, I can see stock for Location Product in FRE/CADE as well as when I run /FRE/FU_TOOLS_READ_STOCK. However in the generated OP's when I click on Calculation details, the field Stock considered for FRP is 0. The stock field in /FRE/MATLOC_FRP is

  • How can I get a replacement for my Install DVD?

    I already had installed Logic Studio on my iMac. Now I wanted to install it on my MacBook as well. When I took out the Install DVD from the insertion slot of my MacBook Pro, the edge of the slot scratched the top of the DVD and damaged it. ( How's th

  • How to creat a Dialer Program in Java

    Help me in creating a Dialer program which dials to a specifie ISP.It should work like the Dialer provided in windows.Help!! Can we code such a program in JAVA.If yes, HOW!!!! Abhishek([email protected])

  • Issue in triage codes in reactive repair order

    Hi, I am working on service module of SAP CRM 5.0 system. When I create a service order for reactive repair, I am able to add a few triage codes for items. when I try to create a confirmation order for the same reactive repair service order, the tria