Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3214774
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:06:01+00:00 2026-05-17T15:06:01+00:00

I have a list view class that just like NSCollectionView requires an additional prototype

  • 0

I have a list view class that just like NSCollectionView requires an additional prototype item and a prototype view to be of any use.
When dropping an NSCollectionView from the library in Interface Builder those two helper items are automatically created. However I couldn’t find a single official Apple document dealing with this use case (describing how its done).

Digging thru the Apple Dev Guides I could however find “ibDidAddToDesignableDocument:”.
With the following code I managed to get my auxiliary items created on drop from library:

- (void)ibDidAddToDesignableDocument:(IBDocument *)document {
    [super ibDidAddToDesignableDocument:document];

    NSView *prototypeView = [[[NSView alloc] initWithFrame:NSMakeRect(0.0, 0.0, 300, 65.0)] autorelease];
    DLListViewItem *prototypeViewItem = [[[DLListViewItem alloc] initWithNibName:nil bundle:nil] autorelease];

    [document addObject:prototypeViewItem toParent:nil];
    [document addObject:prototypeView toParent:nil];

    [document connectOutlet:@"view" ofSourceObject:prototypeViewItem toDestinationObject:prototypeView];
    [document connectOutlet:@"listView" ofSourceObject:prototypeViewItem toDestinationObject:self];
    [document connectOutlet:@"prototypeItem" ofSourceObject:self toDestinationObject:prototypeViewItem];
}

However…

…IB adds those aux items for NSCollectionView only on the actual initial drag from the library, not on any other call of “ibDidAddToDesignableDocument:”, such as when embedding, copying or duplicating the item. (while my method would, and on all)

This makes me wonder whether Apple actually uses “ibDidAddToDesignableDocument:” for this and if I’m on the right track with this at all.

How does one imitate this properly? I’m having a hard time trying to distinguish between different contexts for “ibDidAddToDesignableDocument:”. Anybody successfully done this?
Unfortunately none of Google, Google Code, GitHub, or the documentation revealed anything helpful, so I’m in desperate need of help here. 🙁

Thanks in advance!

Edit: Oh great, this question just brought me the tumbleweed badge, yay! Not.
I’m more into useful answers actually, but thanks anyway 😉

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:06:02+00:00Added an answer on May 17, 2026 at 3:06 pm

    I struggled with this on a plugin I did myself a while ago. In my case I was able to check a property of the object to see if it had been initialized already and skip adding the auxilliary objects in that case. I believe BWToolkit uses some internal checking that is similar. Couldn’t you check your object’s ‘prototypeItem’ property to see if you need to skip creating your aux objects?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a custom widget that I would like to use in multiple
The title just about says it all. I have a complex EF4 entity object
This is a Rails 3 application. I have images that can be tied to
Background I have a payment page where the user can select from a list
I want to create a model that doesn't map to a database table. Instead,
I have a table called People with a columns of datatype xml called properties
Am following the tutorial here on creating a simple todo list app: http://www.mydroid.apnafundaz.com/2010/07/todolist-application-in-android-step-by-step-guide-with-screen-shots/ Have
This seems like it should be easy yet I must be missing something. I
OK my original post: Url.Action is throwing error CS1026: ) expected got answered. However

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.