开发者

How to remove an object from an ArrayController when the content is fetched by "Content Array"-Binding?

I have the following setup using Core Data:

Nib1: A WindowController with two custom views, that loads the views from Nib2 and Nib3.

Nib2: NSTreeController with an custom class, that has an property to fetch some child objects by selection, called selected开发者_Python百科AssetsBySelection. The TreeController prepares its content with CoreData.

Nib3: It is a NSArrayController with the "Content Array" binding bound to selectedAssetsBySelection of the NSTreeController of Nib2.

The Array in Nib3 is notified about selection changes by

[contextViewController bind:@"selectedAssets" toObject:naviViewController.treeController withKeyPath:@"selectedAssetsBySelection" options:nil];

within Nib1, the window controller.

Everything works fine and when I select an object within the TreeController in Nib2 the array in Nib3 is updated and when I change the title of an object in Nib3 it is also persisted.

All Array Controllers are also bound to the correct managed Object Context.

Now to the problem: When I delete an object via remove-Action of Array Controller in Nib3 I get an EXC_BAD_ACCESS-Error.

How to remove an object from an ArrayController when the content is fetched by "Content Array"-Binding?

Anybody a clue?

Best regards, hijolan


Yeah!!!! I made it... ;)

I had to check these two checkboxes on the arraycontroller in Nib3:

How to remove an object from an ArrayController when the content is fetched by "Content Array"-Binding?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜