Re: NSComboBox Coredata bindings
Re: NSComboBox Coredata bindings
- Subject: Re: NSComboBox Coredata bindings
- From: Julien Bordet <email@hidden>
- Date: Wed, 30 Nov 2005 19:13:07 +0100
Hi,
My Transaction Array Controller is in Entity mode, 'Automatically
prepares content' and is bound to ManagedObjectContext from my
PersistentDocument (MyDocument).
It is the same for my Category Array Controller.
The categories are programmatically added thanks to the following code :
---Start Code---
static char *CategoryDefaults[ maxCategoryDefaults ] =
{
"Car", "House"
};
for (i = 0; i < 2; i++) {
NSString *typeString = [NSString stringWithCString:CategoryDefaults[i]];
NSManagedObject *type = [NSEntityDescription
insertNewObjectForEntityForName:@"Category"
inManagedObjectContext:managedObjectContext];
[type setValue:typeString forKey:@"category"];
}
---End Code---
Notice that it is never directly added to the Category controller.
That is another thing that I find weird...
As I said, everything is OK except adding category through the
interface. I try to fill the NSComboBox with, say, "Food", and
validate with enter. Then I get the error message I mentioned in my
first message.
What other information do you need ?
Many thanks
Julien
2005/11/30, Wain <email@hidden>:
> Hi,
>
> Can you give a little more information about how your controller is
> setup
> and how you are adding the new category via the interface.
>
> You bindings look reasonable (especially if it currently works if you
> add
> a category programmatically).
>
> Wain
>
>
> On 30 Nov 2005, at 15:46, Julien Bordet wrote:
>
> > Hi
> >
> > I've search through the archives, and found some threads about this
> > subject, but nothing answering my question... If I'm wrong I'd be
> > happy to be redirected to interesting posts.
> >
> > My main question is : how to use bindings and NsComboBox correctly.
> > More particularly, I want the application user to be apple to add item
> > through the interface.
> >
> > I've created a NSArrayController that is responsible for a set of
> > NSManagedObjects.
> >
> > One of the related entity property is a 'category' relationship.
> > Another CategoryArrayController is associated to that entity.
> >
> > What I want to do is to manage Categories through a NSComboBox. I've
> > set bindings to :
> >
> > content : CategoryArrayController.arrangedObjects
> >
> > contentValues : CategoryArrayController.arrangedObjects.category
> >
> > value : TransactionArrayController.selection.category
> >
> > That works fine for programmatically added category value : I can
> > select them through the NSComboBox. However, I cannot add a new
> > category through the user interface. When I enter it, I get a message
> > :
> >
> > 2005-11-28 11:44:10.198 test[426] *** -[NSCFString? _isKindOfEntity:]
> > selector not recognized [self = 0x3f7b90]
> >
> > Does anyone have a idea for that ?
> >
> > Kind regards
> >
> > Julien
> >
>
>
>
> ___________________________________________________________
> To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden