I created an object and it shows up, but it isn't selected in the EODisplayGroup

From EOFWiki
Jump to: navigation, search

Description

In your code, you are doing something like:

  foo = [[Foo new] autorelease];
  [editingContext insertObject:foo];
  [bar addToChildren:foo];
  [foo setParent:bar];

On the UI you see that the foo object appears in the EODisplayGroup (showing foo children of bar), but it is not automatically selected.

Why it isn't selected

The EODisplayGroup will see, when it is notified of the EOEditingContext change, that a new object has appeared, but tries to preserve the current selection. So the old object stays selected.

(Note: may change this in a future MulleEOF version)

Fix

For simple code like this, write instead

  [fooDisplayGroup insert:nil];

and the rest will happen automatically with the help of EOClassDescription.

Personal tools