Re: IKImageBrowserView setSelectionIndex not selecting
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