Re: IB Plugin Container View and child management
Re: IB Plugin Container View and child management
- Subject: Re: IB Plugin Container View and child management
- From: Kevin Cathey <email@hidden>
- Date: Mon, 3 May 2010 09:46:22 -0700
Hi Patrick,
Currently, there is no API to accomplish this. Please feel free to file an enhancement request.
Kevin
On 3 May 2010, at 05:33, Patrick Mau wrote:
> Dear list members
>
> I have created in IB Plugin based on the Xcode template and everything works fine.
> If you need the completly boring source to help me out I can upload the full project somewhere.
>
> Here's what I'd like to accomplish:
>
> I have a custom NSView subclass that is configured to be a container for other objects.
> Exposing child objects using "- (NSArray *)ibDefaultChildren" works as expected.
>
> Now I want to be able to drag other Library Objects from my IBPlugin inside the container but limiting
> the objects to certain classes.
>
> How does IB determine the possible drop locations for dragged library objects?
>
> I have implemented:
>
> - (void)ibDidAddToDesignableDocument:(IBDocument *)document
> {
> NSObject *parent;
>
> parent = [document parentOfObject:self];
>
> NSLog(@"ibDidAddToDesignableDocument: %@", document);
> NSLog(@" parent: %@", parent);
>
> // Try to remove ourself when added to the wrong parent
> if ([parent isKindOfClass:[self class]] == NO) {
> [document removeObject:self];
> NSLog(@" removed");
> }
> }
>
> I assumed (wrongly) that I might be able to check the parent object and remove the
> just-added instance, but that leads to a nice "assertion failure" in IB.
>
> Is there any way for a object to refuse itself to be dropped in certain locations?
>
> Thanks a lot
> Patrick
>
> _______________________________________________
>
> 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