Thank you for your tips! But I didn't understand everything. Do you tried this in a sampleproject which you can send me?

If I initialize the imageBrowser in my MYNSCollectionViewItem and set the datasource, the datasource methods will now be called correctly. Thank you. But it seems that the IKImageBrowserView which is displayed will not display anything, even if I reload the imageBrowser data manually:

- (id)initWithCoder:(NSCoder *)decoder {
        imageBrowser = [[IKImageBrowserView alloc] init];
        [imageBrowser setDataSource:self];      
        return self;
}


// -------------------------------------------------------------------------
//      numberOfItemsInImageBrowser:view
// -------------------------------------------------------------------------
- (int)numberOfItemsInImageBrowser:(IKImageBrowserView*)view
{
        MyObject *representedObject = [self representedObject];
        return [representedObject.myImages count];
}

// -------------------------------------------------------------------------
//      imageBrowser:view:index:
// -------------------------------------------------------------------------
- (id)imageBrowser:(IKImageBrowserView *) view itemAtIndex:(int) index
{
        MyObject *representedObject = [self representedObject];
        return [representedObject.myImages objectAtIndex:index];
}

- (IBAction)refreshView:(id)sender {
        [imageBrowser reloadData];
}

Regards...Manu


On Jun 12, 2008, at 16:32 , Jens Alfke wrote:

I got it working like this:
- put your custom view initialisation in initWithCoder: (as that is the one used to copy the original instance / unarchive your nib)
You mean my customized NSCollectionView, didn't you?

- in your view, have an IBOutlet that's connected to the NSCollectionViewItem instance (called cvItem in my case) - in awakeFromNib bind the properties you're interested in (as these get restored / set correctly in the cloning process), e.g.
- (void)awakeFromNib
-I don't need this do I?


{
[self bind:@"plotRoot" toObject:cvItem withKeyPath:@"representedObject" options:nil];

[self bind:@"isSelected" toObject:cvItem withKeyPath:@"selected" options:nil];
}

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to