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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:26:13+00:00 2026-06-14T21:26:13+00:00

my NSData object contains within byte of a photo. I would like to convert

  • 0

my NSData object contains within byte of a photo.
I would like to convert this object to a UIImage.
My problem is that he could not give a name all’oogetto UIImage. example myphoto.jpg

this is my code:

NSString * bytestring =(NSString *)[bean image];

//contain byte of my photo
NSData * byte = [bytestring dataUsingEncoding:NSUTF8StringEncoding];


UIImage *image=[[UIImage alloc]initWithData:byte];


UIButton *bt=[[UIButton alloc]initWithFrame:CGRectMake(80,80,100,100)];

[bt setImage:image forState:UIControlStateNormal];
[self.boxView addSubview:bt];

the button does not display my photos.
how can I do?

  • 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-14T21:26:14+00:00Added an answer on June 14, 2026 at 9:26 pm

    Since it appears that [bean image] is actually a base 64 encoding of the image’s data, you need to use a method to convert the encoded data back into unencoded data.

    There is no standard method for this but there are plenty you can find and use. Your code then becomes something like this:

    NSString *byteString = [bean image]; // no need for a cast if it's already an NSString
    NSData *byte = // call some method to convert base 64 encoded string into an NSData object
    

    Have a look at:

    convert base64 decoded NSData to NSString

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

Sidebar

Related Questions

I have an object that I convert into NSData using an NSKeyedArchiver and then
I have an NSArray that contains date strings (i.e. NSString) like this: Thu, 21
I've got an NSData object that supposedly contains image data in the TIFF format.
i have a NSData object. I want to convert it to a string, pass
I have a NSData object, i need to convert it a NSDictionary object. NSData
I have an NSData object that represents a Facebook user provided by the IOS
I have an NSData object that consists of several HTTP responses or requests concatenated
Does anyone know how to convert a NSDictionary object into an NSData object as
I am saving arrays of doubles in an NSData* object that is persisted as
I have a view that I pass a viewmodel object to that contains an

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.