• 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: [iPhone] Caching images fetched from a URL?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [iPhone] Caching images fetched from a URL?


  • Subject: Re: [iPhone] Caching images fetched from a URL?
  • From: "Eric E. Dolecki" <email@hidden>
  • Date: Wed, 13 May 2009 15:04:18 -0400

I haven't seen performSelectorOnMainThread before.
Should that call go into the selector method that's called? ie...

// This kicks off a thread
[NSThread detachNewThreadSelector:@selector(threadLoad:) toTarget:self
withObject:myArrayWithDictionary];

Now...

-(void)threadLoad:(id)param {
    // param = the myArrayWithDictionary object I assume
    // interogate the object and get vals, and then
    [myCell performSelectorOnMainThread:@selector(setImage:)
withObject:myImage waitUntilDone:YES];
}

?



On Wed, May 13, 2009 at 2:53 PM, Luke the Hiesterman <email@hidden>wrote:

>
> On May 13, 2009, at 11:45 AM, Eric E. Dolecki wrote:
>
>  So is it safe to approach threads like they were timers? You start a
>> thread, and it calls back to it's selector method when it's complete
>> (detachNewThreadSelector:toTarget:withObject)?
>>
>
> I would conclude my thread with a line like:
>
> [myCell performSelectorOnMainThread:@selector(setImage:)
> withObject:myImage waitUntilDone:YES];
>
> That should set your cell's image to the image you just downloaded.
>
>
>> Now - what if a thread completes and the cell is currently out of view (it
>> was scrolled) - do the internals take care of that, or could it cause an
>> error?
>>
>
> I wouldn't worry about setting cells to images that are out of view. An
> implementation that waits for cells to come back into view would be tedious
> and probably unnecessary.
>
> Luke
>



--
http://ericd.net
Interactive design and development
_______________________________________________

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: [iPhone] Caching images fetched from a URL?
      • From: Luke the Hiesterman <email@hidden>
References: 
 >[iPhone] Caching images fetched from a URL? (From: "Eric E. Dolecki" <email@hidden>)
 >Re: [iPhone] Caching images fetched from a URL? (From: Michael Vannorsdel <email@hidden>)
 >Re: [iPhone] Caching images fetched from a URL? (From: "Eric E. Dolecki" <email@hidden>)
 >Re: [iPhone] Caching images fetched from a URL? (From: Alex Kac <email@hidden>)
 >Re: [iPhone] Caching images fetched from a URL? (From: "Eric E. Dolecki" <email@hidden>)
 >Re: [iPhone] Caching images fetched from a URL? (From: "Bradley S. O'Hearne" <email@hidden>)
 >Re: [iPhone] Caching images fetched from a URL? (From: "Eric E. Dolecki" <email@hidden>)
 >Re: [iPhone] Caching images fetched from a URL? (From: Luke the Hiesterman <email@hidden>)
 >Re: [iPhone] Caching images fetched from a URL? (From: "Eric E. Dolecki" <email@hidden>)
 >Re: [iPhone] Caching images fetched from a URL? (From: Luke the Hiesterman <email@hidden>)

  • Prev by Date: Re: [iPhone] Caching images fetched from a URL?
  • Next by Date: Re: [iPhone] Caching images fetched from a URL?
  • Previous by thread: Re: [iPhone] Caching images fetched from a URL?
  • Next by thread: Re: [iPhone] Caching images fetched from a URL?
  • Index(es):
    • Date
    • Thread