iphone - Update views while being touched -


i having app load images in uitableview. each row has image view.

  1. i download images url , assign uiimageview. problem here image views not updating if dragging table view. updates when release finger.

  2. another problem have label in cells shows counter incremented using timer. timer action not getting called when finger on table view.

how do updates in both these cases?

may basic question. have no clue.

thanks everyone!

edit: have noticed -connection:didreceiveresponse: method not getting called when view being touched.

edit 2: tried adding run loop nsurlconnection. method looks this.

- (void)start {      nsmutableurlrequest* request = [[nsmutableurlrequest alloc] initwithurl:self.imageurl cachepolicy:nsurlrequestreturncachedataelseload timeoutinterval:self.timeoutinterval];     [request setvalue:@"gzip" forhttpheaderfield:@"accept-encoding"];       _connection = [[nsurlconnection alloc] initwithrequest:request delegate:self startimmediately:yes];      nsport* port = [nsport port];     nsrunloop* rl = [nsrunloop currentrunloop]; // runloop     [rl addport:port formode:nsrunloopcommonmodes];     [_connection scheduleinrunloop:rl formode:nsrunloopcommonmodes];     [_connection start];     [rl run]; } 

this loads images when touching on view. table view scrolling slowly. not scrolling. moves when drag. no movement after release finger.

problem 1

the solution use downloading mechanism doesn't blocked while drag table view. sdwebimage asynchronous image downloader cache support uiimageview category. let image view updated if dragging table. have faced same issue in project used sdwebimage. call do.

 [cell.imageview setimagewithurl:[nsurl urlwithstring:@"http://www.domain.com/path/to/image.jpg"]                    placeholderimage:[uiimage imagenamed:@"placeholder.png"]]; 

problem 2

if scheduledtimer not called while main thread tracking touches. this. create timer , add loop

nstimer* timer = [nstimer timerwithtimeinterval:1.0f target:self selector:@selector(updatelabel:) userinfo:nil repeats:yes]; [[nsrunloop mainrunloop] addtimer:timer formode:nsrunloopcommonmodes]; 

this not interrupt timer.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -