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

  • Home
  • SEARCH
  • 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 6952595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:22:10+00:00 2026-05-27T14:22:10+00:00

the error-message i quoted in question-title is driving me crazy on my iPad. i

  • 0

the error-message i quoted in question-title is driving me crazy on my iPad.

i am downloading some Jpeg-Files form HTTP-Servers, and using my code works fine on the iphone (iOS 5.0). On my iPad (4.3) it messages this error and the image cannot be displayed.

What makes me wonder is how i fixed it, which is not clear to me!

So i am Downloading the Jpeg via NSURLConnection (conn) and a NSMutableData (imageData):

conn = [[NSURLConnection alloc] 
       initWithRequest:[NSURLRequest requestWithURL:[camera getJpgUrl] 
                                        cachePolicy:NSURLRequestReloadIgnoringLocalCacheData 
                                    timeoutInterval:10] 
                       delegate:self 
                       startImmediately:YES];

if(conn && !imageData)
{
    imageData = [[NSMutableData data] retain];
}

the delegate-methods are :

1) getting more data

-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
    [imageData appendData:data];
}

2) having all the data:

-(void)connectionDidFinishLoading:(NSURLConnection *)aConnection
{
    UIImage *img = [UIImage imageWithData:imageData];

    [imageData setLength:0];
    [conn release];
    conn = nil;

    if(img)
    {
        imageView.image=img;
    }
}

Hooray sais the iphone, welcome yells the image.

On the iPad however, i have to release the imageData-Object instead of settings its length to 0 when i restart that method initializing the NSUrlConnection. i restart it for image-updates etc.

So the code in iPad is (just to sum it up):

-(void)connectionDidFinishLoading:(NSURLConnection *)aConnection
{
    UIImage *img = [UIImage imageWithData:imageData];

    [imageData release];
    imagedata = [[NSMutableData data] retain];
    conn release];
    conn = nil;

    if(img)
    {
        imageView.image=img;
    }
}

So for now, the imageData handling in my code is a result of testing, so i could change it to have a move elegant handling. Thats not so important.

But what makes me wonder is, why does setLength:0 does what it should on ios5/iphone4, but not on ipad? i hope that i just messed up something, but here i really dont understand what is going on.

Any thoughts ?

Thank you!

  • 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-27T14:22:11+00:00Added an answer on May 27, 2026 at 2:22 pm

    okay, the server hat some bugs :/

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

Sidebar

Related Questions

I'm having an error message when inserting content which contains quotes into my db.
Error message doesn't display on mysql connect failure if( ! $this->remote_connection_id = @mysql_connect($vars['hostname'], $vars['username'],
When error message is a long string, how to make the message be displayed
The error message I gen when I try to access the web page server
My Error message: Request for member nameField in something not a struct or union
As the error message stated below, I do not use user_profiles_path as plural because
Got this error message while trying to load view: The model item passed into
I want to display error message or alert message after checking the condition. here
I get this error message in LogCat: 06-25 15:17:34.495: E/AndroidRuntime(5891): java.lang.RuntimeException: Unable to start
I get this error message pageContext cannot be resolved but I have no variable

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.