• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
IB Plugin Container View and child management
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

IB Plugin Container View and child management


  • Subject: IB Plugin Container View and child management
  • From: Patrick Mau <email@hidden>
  • Date: Mon, 03 May 2010 14:33:57 +0200

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

  • Follow-Ups:
    • Re: IB Plugin Container View and child management
      • From: Kevin Cathey <email@hidden>
  • Prev by Date: Re: Value Bindings in IB - Where's the documentation?
  • Next by Date: Re: Strange NSScroller sizing behaviour
  • Previous by thread: Re: Strange NSScroller sizing behaviour
  • Next by thread: Re: IB Plugin Container View and child management
  • Index(es):
    • Date
    • Thread