Re: Programmatically get treecontroller selection
Re: Programmatically get treecontroller selection
- Subject: Re: Programmatically get treecontroller selection
- From: "Hamish Allan" <email@hidden>
- Date: Wed, 21 May 2008 20:45:47 +0100
I'd like to reiterate what Quincey noted:
"BTW, I notice that the "Cannot perform operation without a managed
object context" error is logged *before* you log "default". The
problem is not apparently anything to do with getting the selection in
the code you posted, since it happens before you do that."
You should try to find out what causes the "Cannot perform..." message
first and foremost -- perhaps by setting a breakpoint on NSLog()?
Hamish
On Wed, May 21, 2008 at 7:32 PM, Jonathan Dann <email@hidden> wrote:
>>
>> - (void)getSelectedAccount{
>>
>> NSString *accountName = @"Bank";
>> NSLog(accountName);
>> accountName = [[MLoutlineViewController selection]
>> valueForKey:@"name"];
>> NSLog(accountName);
>>
>> //get managedObjectContext in preparation for fetch code
>> moc = [MLappDelegate managedObjectContext];
>>
>> }
>
> At first glance, try NSTreeController's -selectedObjects and -selectedNodes
> methods rather than -selection. Also, in my experience I've not found is
> necessary to bind the selectionIndexPath(s) to the outline view to get it
> all to work, maybe unbind that as a quick test?
>
> Jon
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden