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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:59:24+00:00 2026-06-18T07:59:24+00:00

I have JSON that contains base64 decoded PNG-images that I add to Core Data.

  • 0

I have JSON that contains base64 decoded PNG-images that I add to Core Data. I would like to show those images in Image Wells with bindings to my Core Data model.

The problem is that I cannot use Data with NSArchiveFromData since it’s been deprecated.

My problem is similar to this but I don’t really understand the answer.

Does anyone have an idea?

Thanks

  • 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-18T07:59:25+00:00Added an answer on June 18, 2026 at 7:59 am

    Try something to the effect of this (I’m not sure if you’re just using a binding on a property, or using an NSArrayController – I’ll try to answer both scenarios)

    You could take the string from your json and decode it:
    (You’ll need the open source library referenced in the stackoverflow answer: https://stackoverflow.com/questions/14260936/decode-an-encoded-base64-image-in-c-sharp-in-objective-c)

    NSString *jsonImage = [jsonData objectForKey@"image"];
    NSData   *data      = [NSData dataWithBase64EncodedString:jsonImage];
    

    Then init your image with that data.

    If you’re using an NSArrayController to manage your core data, create a value transformer that returns an image.

    Create a subclass of NSValueTransformer and name it whatever you’d like. In the implementation, add:

    +(Class)transformedValueClass {
        return [NSImage class];
    }
    -(id)transformedValue:(id)value {
        if (value == nil) {
            return nil;
        } else {
            NSData *data = [NSData dataWithBase64EncodedString:value]; //might be [value stringValue]
            return [[NSImage alloc] initWithData:data];
        }
    }
    

    Then in interface builder where you’ve set the binding on the image, just set the Value Transformer to the class you made.

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

Sidebar

Related Questions

I have a JSON result that contains numerous records. I'd like to show the
I have a JSON that contains the following: {p1:{debris:{titanium:0,silicum:0}},p2:{debris:{titanium:0,silicum:0}}... I declare the data using
I have a text file that contains cached data in JSON format. I'm trying
I have a JSON string that I would like to include as a value
I have a dictionary in Python that I would like to serialize in JSON
For example lets say I have a JSON object that contains states and cities.
I have a large JSON file that contains A LOT of similar code. It's
I have a variable that contains the following JSON string: { 0 : Jun
I have JSON text that looks like this: { ok: true, totalPages: 256, arReports:
I have some JSON that contains thousands of different CSS selectors, here's a sample

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.