• 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
Re: Troubles with CollectionView and IKImageBrowserView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Troubles with CollectionView and IKImageBrowserView


  • Subject: Re: Troubles with CollectionView and IKImageBrowserView
  • From: Manuel <email@hidden>
  • Date: Thu, 12 Jun 2008 22:28:31 +0200

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 (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


References: 
 >Re: Troubles with CollectionView and IKImageBrowserView (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Accessors Question
  • Next by Date: Re: argument checks
  • Previous by thread: Re: Troubles with CollectionView and IKImageBrowserView
  • Next by thread: From c array to NSImage
  • Index(es):
    • Date
    • Thread