• 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: reloading IKImageBrowserView in an IBAction
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reloading IKImageBrowserView in an IBAction


  • Subject: Re: reloading IKImageBrowserView in an IBAction
  • From: Claus Guttesen <email@hidden>
  • Date: Wed, 4 Mar 2009 06:35:11 +0100

> I read the excellent article 'Image Kit Programming Guide' at
> http://developer.apple.com/documentation/graphicsimaging/Conceptual/ImageKitProgrammingGuide/Introduction/chapter_1_section_1.html#//apple_ref/doc/uid/TP40004907-CH1-SW1
> and have my ImageBrowser working. I want to use it as the basis of an
> image-uploader and would like to visualize the upload-progress by
> removing the first image. I have connected a button to an IBAction and
> can remove the images one by one.
>
> I changed the 'if' to a 'while' but it doesn't animate removals one by
> one but is waiting with [mImageBrowser reloadData] until all images
> are removed (perhaps IBAction blocks it?) and remove all images at
> once.
>
> How can I make the [mImageBrowser reloadData] refresh within the while-loop?

Answering my own question! :-)

Another thread (regarding nstimer) put me on the right track. Reading
about nstimer suggested the use of nsthread, so wrapping the removal
of images into a thread solved my issue:

-(void)removeImages:(id)sender {
	while ( more images to remove ) {
		[mImages removeObjectAtIndex:0];
		[mImageBrowser reloadData];
		etc.
	}
}

- (IBAction)listImagesButtonClicked:(id)sender {
	NSThread *myThread = [[NSThread alloc] initWithTarget:self
selector:@selector(removeImages:) object:nil];
	[myThread start];
}

--
regards
Claus

When lenity and cruelty play for a kingdom,
the gentler gamester is the soonest winner.

Shakespeare
_______________________________________________

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: 
 >reloading IKImageBrowserView in an IBAction (From: Claus Guttesen <email@hidden>)

  • Prev by Date: Re: All my leaks are gone... but now a memory warning?!
  • Next by Date: Re: Getting NSDate from EXIF of a image
  • Previous by thread: reloading IKImageBrowserView in an IBAction
  • Next by thread: Re: Rotate NSImage to get a new NSImage, without drawing
  • Index(es):
    • Date
    • Thread