Git Product home page Git Product logo

Comments (3)

ZoeSummers avatar ZoeSummers commented on July 20, 2024

Found a threaded solution here:

http://www.switchonthecode.com/tutorials/loading-images-asynchronously-on-iphone-using-nsinvocationoperation

from asyncimageview.

nicklockwood avatar nicklockwood commented on July 20, 2024

Hi Zoe,

Using it is very simple, basically if you have an image on the web, you get a reference to it as follows:

NSURL *imageURL = [NSURL URLWithString:@"http://example.com/images/foo.jpg"];

If you are trying to load a file from your application bundle, get a reference to it as follows:

NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"foo" ofType:@"jpg"];
NSURL *imageURL = [NSURL fileURLWithPath:path];

Once you've got your URL, to display it on the screen, just get any ordinary UIImageView and load the image by saying:

imageView.imageURL = imageURL;

As soon as you set this property, the image will start loading in the background and will appear in the image view once it's loaded.

If you're using it with iCarousel, you probably want to set the imageURL in the carousel:viewForItemAtIndex: method when you create the imageView.

Nick

On 18 Aug 2011, at 14:27, ZoeSummers wrote:

Hi

I'm obviously being very thick but I can't work out how to use this from just looking at the .h file and reading the notes on this site.

I'm trying to use this in conjunction with your iCarousel, but as a tester, I'm just trying to get a single UIImageView placed in the view in IB to work.

Do you know of any sample projects (Xcode 4) that I can use for reference?

Sorry...

Z

Reply to this email directly or view it on GitHub:
https://github.com/demosthenese/AsyncImageView/issues/1

from asyncimageview.

nicklockwood avatar nicklockwood commented on July 20, 2024

Not sure what you mean by "found a threaded solution" - AsyncImageView also uses threading.

from asyncimageview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.