Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4080914
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:59:30+00:00 2026-05-20T17:59:30+00:00

I am using a TTImageView (from three20) to display an image from the web.

  • 0

I am using a TTImageView (from three20) to display an image from the web.

self.pic = [[TTImageView alloc] initWithFrame:CGRectMake(25, 25, 100, 100)]; 
self.pic.urlPath = @"http://www.google.com/images/logos/ps_logo2.png";
[self.pic sizeToFit];
NSLog(@"%f %f %f %f", self.pic.frame.origin.x, self.pic.frame.origin.y, self.pic.frame.size.width, self.pic.frame.size.height);

the image loads and displays perfectly but the NSLog returns “25.000000 25.000000 0.000000 0.000000”. How do I get this to return the correct frame?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T17:59:31+00:00Added an answer on May 20, 2026 at 5:59 pm

    It’s been a while since I used TTImageView, but what I imagine is happening is the following:

    1. You ask TTImageView to load a new image from a URL
    2. Immediately after you set the URL path, you call sizeTo Fit
    3. …but the image actually hasn’t been downloaded yet, so the frame is set to zero because no image exists at that time

    TTImageView will download asynchronously – that is, in the background. You need to use the delegate function TTImageViewDelegate (documented here) to get a call back when the image has finished loading, at which point you should call sizeToFit.

    Currently, you’re firing off a request to download the image – a process that could take several seconds on 3G, and still a fair amount of time on WiFi- and then the next line asks to resize the frame. You need to call sizeToFit after you’re sure the image download has finished, which is what the delegate methods are for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Three20's TTImageView for it's async image loading + caching. I've noticed this
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
Using JDeveloper , I started developing a set of web pages for a project
I'm using the three20 project for my iPhone app. I've narrowed my problem down
Using mercurial, I've run into an odd problem where a line from one committer
Using php/html, I want to retrieve email addresses (plus other information) from MySQL and
Using this code, the following execution yields strange results: C 100 R W The
I created a custom AQGridViewCell. By using UIImageView everything works. The image appears and
In my app I'm using base adapter to display continents on list view.I want
Using Browserlab, it appears that the background image is not centred in Firefox7 for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.