Starting editing a Row as soon as it is Added.

Joshua Garnham <joshua.garnham-/[email protected]>
Newsgroups gmane.comp.macosx.devel
Message-ID <[email protected]>
I have an NSOutlineView and what I want to happen is that when a row is
added I want the row that has been added to Start Editing immediately
like when you double click on a row.

I've tried this:

NSObject *p = [treeController newObject];
[treeController addObject:p];

NSManagedObjectContext *moc = [self managedObjectContext];
NSEntityDescription *entityDescription = [NSEntityDescription
entityForName:@"projects" inManagedObjectContext:moc];
NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease];
[request setEntity:entityDescription];

NSError *error = nil;
NSArray *a = [moc executeFetchRequest:request error:&error];

// Find the row of the new object
int row = [a indexOfObjectIdenticalTo:p];

// Start editing in the second column
[outlineView editColumn:1
                    row:row
              withEvent:nil
                 select:YES]; 

However, it seems that just edits any row in my Outline View.
What have I done wrong??

Josh
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.