• 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: How to use bindings with IKImageBrowserView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use bindings with IKImageBrowserView?


  • Subject: Re: How to use bindings with IKImageBrowserView?
  • From: "Adam Gerson" <email@hidden>
  • Date: Fri, 4 Apr 2008 17:18:45 -0400

It does work. I have defined a core data entity that conforms to
IKBrowerItem protocol and my IKImageBrowserView is working with
bindings. I think you still need to point the delegate and data source
outlets to an object that implements the datasource methods:



// -------------------------------------------------------------------------
//	numberOfItemsInImageBrowser:view
// -------------------------------------------------------------------------
- (int)numberOfItemsInImageBrowser:(IKImageBrowserView*)view
{
	// The item count to display is the datadsource item count.
    return [[imageBrowserArrayController arrangedObjects] count];
}

// -------------------------------------------------------------------------
//	imageBrowser:view:index:
// -------------------------------------------------------------------------
- (id)imageBrowser:(IKImageBrowserView *) view itemAtIndex:(int) index
{
    return [[imageBrowserArrayController arrangedObjects] objectAtIndex:index];
}


// Implement some optional methods of the image browser  datasource
protocol to allow for removing and reodering items.

// -------------------------------------------------------------------------
//	removeItemsAtIndexes:
//
//	The user wants to delete images, so remove these entries from the
data source.
// -------------------------------------------------------------------------
- (void)imageBrowser:(IKImageBrowserView*)view removeItemsAtIndexes:
(NSIndexSet*)indexes
{
	[imageBrowserArrayController removeObjectsAtArrangedObjectIndexes:indexes];
}


On Fri, Apr 4, 2008 at 1:01 AM, Steve Weller <email@hidden> wrote:
>
>  I am attempting to use bindings to supply an IKImageBrowserView with data.
> I have successfully used IKImageBrowserView with a data source, but cannot
> get bindings to work. Should it work with bindings?
>
>  The array controller's contentArray is hooked up to an NSMutableArray
> called storedImages. That contains instances of storedImage. And those have
> a method browserObject that returns instances of an object that implements
> the IKBrowerItem protocol to fetch and display an image (uid, path, etc).
>
>  The Image Kit browser is bound to the array controller's arranged objects
> with the model key path browserObject. It is set to automatically prepare
> content.
>
>  I get no images displayed even though there are plenty in the storedImages
> array. I am telling the browser view to reload its data.
>
>  If I set a breakpoint at browserObject, it is never hit. So it looks like
> the array controller is never attempting to read my model. I get no errors
> when loading my nib.
>
>
>  --
>  Blog:  http://www.bagelturf.com/   Photos: http://bagelturf.smugmug.com/
>
>
>
>
>  _______________________________________________
>
>  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

  • Follow-Ups:
    • Re: How to use bindings with IKImageBrowserView?
      • From: Steve Weller <email@hidden>
References: 
 >How to use bindings with IKImageBrowserView? (From: Steve Weller <email@hidden>)

  • Prev by Date: Re: NSTask failing
  • Next by Date: Re: NSTask failing
  • Previous by thread: How to use bindings with IKImageBrowserView?
  • Next by thread: Re: How to use bindings with IKImageBrowserView?
  • Index(es):
    • Date
    • Thread