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 6013173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:30:38+00:00 2026-05-23T02:30:38+00:00

EDIT: solved. I just forgot to use the delegater object in the viewDidLoad method.

  • 0

EDIT: solved. I just forgot to use the delegater object in the viewDidLoad method. Check the code and comments to see what I mean.

This is sort of a compound question with one that I had asked before. I am trying to download an image and put it on an iPhone screen using NSURLConnection (which I have to use). I have a subview called ImageModel that has the methods for using NSURLConnection, and I have another method in the viewController that is supposed to display the image. Here’s the code:

#import "ImageModel.h"

@implementation ImageModel
@synthesize delegater, receivedData, image;

-(void)initer
{

    NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.gusto-graphics.com/updates/wp-content/uploads/2011/02/SENSE__This_picture_makes_none_by_Mathan552.jpg"] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];
    NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
    if (theConnection) {
        receivedData = [[NSMutableData data] retain];
    } else {
        NSLog(@"Connection Failed.");           
    }
}

//There's a few connection methods after this method, which I didn't really change.

-(void)connectionDidFinishLoading:(NSURLConnection *)connection
{
    image = [UIImage imageWithData:receivedData];

    [delegater performSelectorOnMainThread:@selector(didFinishDownload:) withObject:image waitUntilDone:NO];

    NSLog(@"Success. Received %d bytes of data", [receivedData length]);

    [connection release];
    [receivedData release];
}

@end

receivedData, delegater, and image are all declared in the header file, and there is also a protocol that requires a method called didFinishDownload to be called.

I put this code in the view controller:

- (void)didFinishDownload:(UIImage*)image {
    imageView.image = image;
    [imageView setNeedsDisplay];
}

- (void)viewDidLoad {
    model = [[ImageModel alloc] init];
    [model initer];
    [super viewDidLoad];
}

Both model and imageView are declared in the header file, I made sure to attach imageView to an actual UIImageView in the interface builder, and I’ve even checked to make sure the picture still comes up on the website. Despite all of this, though, all I am getting is a gray screen. Can anyone help?

  • 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-23T02:30:38+00:00Added an answer on May 23, 2026 at 2:30 am

    solved. I just forgot to use the delegater object in the viewDidLoad method.

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

Sidebar

Related Questions

Edit: I have solved this by myself. See my answer below I have set
EDIT: This problem has been solved. See below. Hey all. I'm building an iPhone
EDIT: This question is solved, but I can't accept my own answer just yet.
UPDATE: Solved. Thanks BusyMark! EDIT: This is revised based on the answer below from
EDIT 3: Solved. See below. EDIT 2: I think Chadwick's on the right track
I've just finished making a widget for use on facebook, through Clearsprings. This is
EDIT: Solved with a hack for now. Added at line 473: if (isset($this->_termsFreqs[$termId][$docId])) {
EDIT: SOLVED I JUST HAD TO WAIT FOR AWHILE So I followed the simple
EDIT: Solved this myself - obviously won't work as sorting the dataTable doesn't sort
Edit: I solved this by using strip! to remove leading and trailing whitespaces as

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.