NSOutlineView autosaving expanded items

  • Hello,

    I am working on a Core Data based application and I am trying to use
    NSOutlineView's "autosaving expanded items". The items of the
    NSOutlineView are objects of the "SourceItem" Entity which are hold by
    a NSTreeController.
    The "SourceItem" has 3 main properties. The string attribute "title"
    which is displayed, a to-many relationship "children" and the inverse
    to-one relationship "parent".

    I checked "autosave expaned items" at InterfaceBuilder and set the
    autosave property to "sourceView". After that I created a DataSource
    with dummy methods except the following method:

    - (id)outlineView:(NSOutlineView *)anOutlineView
    persistentObjectForItem:(id)item {
      return [item representedObject];
    }

    When I start the application and expand an item I get the following
    NSLog message:

    *** -[NSUserDefaults setObject:forKey:]: Attempt to insert non-
    property value '(
        <NSManagedObject: 0x1c8a40> (entity: SourceItem; id: 0x17e000 <x-coredata://CDC95DB4-4D2A-4B41-8016-B9034C6388CF/SourceItem/p102
    > ; data: {
        children =    (
            0x186050 <x-coredata://CDC95DB4-4D2A-4B41-8016-B9034C6388CF/SourceItem/p103
    >
        );
        filter = nil;
        isCollapsable = 0;
        isConstant = 1;
        isGroupItem = 1;
        parent = nil;
        title = LIBRARY;
    })
    )' of class 'NSCFArray'.

    Best regards,
    Konrad
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today