• 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: IKImageBrowserView setSelectionIndex not selecting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IKImageBrowserView setSelectionIndex not selecting


  • Subject: Re: IKImageBrowserView setSelectionIndex not selecting
  • From: Graham Cox <email@hidden>
  • Date: Fri, 26 Jun 2009 11:10:26 +1000


On 26/06/2009, at 2:19 AM, Richard Gutierrez wrote:

NSArray* path = [NSArray arrayWithObject:url];
if (path) {
[NSThread detachNewThreadSelector:@selector(addImagesWithPaths:) toTarget:self withObject:path];
}
[imageBrowser setSelectionIndexes:[NSIndexSet indexSetWithIndex: 0] byExtendingSelection:NO];


My guess is that there's nothing to select, because you are loading images in a second thread, and at the time setSelectionIndexes is called, the thread hasn't managed to load even the first image yet.

You'll need to arrange for the thread to tell the main thread when it has done some work so that the first thread can perform the selection.

--Graham


_______________________________________________

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: IKImageBrowserView setSelectionIndex not selecting (From: Richard Gutierrez <email@hidden>)

  • Prev by Date: Re: GC pros and cons
  • Next by Date: Re: NSOutlineView selection disable
  • Previous by thread: Re: IKImageBrowserView setSelectionIndex not selecting
  • Next by thread: stepping in unit test
  • Index(es):
    • Date
    • Thread