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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:09:08+00:00 2026-06-17T17:09:08+00:00

I have successfully converted UIImage in to NSData and sending it to a server

  • 0

I have successfully converted UIImage in to NSData and sending it to a server using SBJson web service.
I am using this code:

img=mainImage.image;
NSData *imgdata=UIImagePNGRepresentation(img);

NSString *post =[[NSString alloc] initWithFormat:@"gid=%@&image=%@",[lblgid text],imgdata];

NSURL *url=[NSURL URLWithString:@"http://www.abchjahdkahdakjskahdk/updategameimage.php"];

here img is UIImage, mainImage is an UIImageView. Everything is going good from this end.
Now on other end where i have to get the Image there ia m facing problem.
I am using this code:

 NSData *imgdata=[abc valueForKey:@"image"];

    imge = [UIImage imageWithData:imgdata];

    imgview=[[UIImageView alloc]initWithImage:imge];

When i print imgdata it is returning the same data as i send from other end but when i am trying to convert this data back in to an UIImage (in second line of above code) it is throwing an exception.

2013-01-22 14:23:43.298 Drase[946:11303] -[__NSArrayI length]: unrecognized selector sent to instance 0x7566800
2013-01-22 14:23:43.298 Drase[946:11303] * Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[__NSArrayI length]: unrecognized selector sent to instance 0x7566800’
*
First throw call stack:
(0x1ce1012 0x111ee7e 0x1d6c4bd 0x1cd0bbc 0x1cd094e 0x1cb1b2 0x881f3 0x87ef4 0x1c659 0x1132705 0x69920 0x698b8 0x12a671 0x12abcf 0x129d38 0x9933f 0x99552 0x773aa 0x68cf8 0x1c3cdf9 0x1c3cad0 0x1c56bf5 0x1c56962 0x1c87bb6 0x1c86f44 0x1c86e1b 0x1c3b7e3 0x1c3b668 0x6665c 0x29d2 0x2905)
libc++abi.dylib: terminate called throwing an exception.

I am not getting any solution for this problem please help me out.

  • 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-06-17T17:09:09+00:00Added an answer on June 17, 2026 at 5:09 pm

    try

      NSData *data = yourData;
    
      UIImage *image = [UIImage imageWithData:data];
    

    or

      NSData *data = yourData;
    
      UIImage *image = [[UIImage alloc] initWithData:data];
      ....
      [image release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have successfully converted my python project to a service. When using the usual
I have connected with the database successfully by using wizard in server explorer. but
I have successfully been using the eclipse Indigo internal browser to view my web
I have installed imagemagick on my windows server and it successfully converted files when
There was a vb.net web service project that I think I successfully converted to
I have code to Post data in server , this is my code List<NameValuePair>
I have successfully implemented a mysql server as a JDBCRealm for authentication in Tomcat
I have successfully converted an OpenGL Window to an std::size_t variable and then converted
I builded nsis script successfully for my java project. I have converted my java
I have converted this simple method from C# to C++. It reads a path

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.