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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:12:09+00:00 2026-06-11T08:12:09+00:00

I have a data model with an entity called Image. This will be used

  • 0

I have a data model with an entity called Image. This will be used to store images.

Previously I had the image as an attribute of a specific entity.

I set up the transformable stuff and it all worked.

However, now I’ve moved it into a separate entity I keep getting errors.

So… This is the Image.m file contents.

#import "Image.h"
#import "Person.h"

@implementation ImageToDataTransformer


+ (BOOL)allowsReverseTransformation {
    return YES;
}

+ (Class)transformedValueClass {
    return [NSData class];
}


- (id)transformedValue:(id)value {
    NSData *data = UIImagePNGRepresentation(value);
    return data;
}


- (id)reverseTransformedValue:(id)value {
    return [[UIImage alloc] initWithData:value];
}

@end

@implementation Image

@dynamic image;
@dynamic createdDate;
@dynamic person;

@end

When I save it it doesn’t complain when I create it it doesn’t complain, I can even see it in the Person entity as an object.

(Person *) $0 = 0x1002dec0 <Person: 0x1002dec0> (entity: Person; id: 0x4f8f30 <x-coredata://2800C028-8745-45FE-854B-5783FF3FC173/Person/p6> ; data: {
    avatar = "0x1007e540 <x-coredata://2800C028-8745-45FE-854B-5783FF3FC173/Image/p1>";
    createdDate = nil;
    email = nil;
    firstname = Blah;
    id = "1234567890987654321234567890";
    lastName = Blah;
    updatedDate = nil;
})

The avatar attribute is a relationship to an Image entity (one to one).

But if I try to access any attribute of the image I get this…

-[_NSObjectID_64_2 createdDate]: unrecognized selector sent to instance 0x1007e540
-[_NSObjectID_64_2 image]: unrecognized selector sent to instance 0x1007e540

etc etc…

Code that generates error…

NSFetchRequest *request = [NSFetchRequest fetchRequestForEntityName:@"Person"];

[request setPredicate... blah];
NSArray *results = [context executeFetchRequest...];

Person *person = [results objectAtINdex:0];

NSLog(@"%@", person.firstName); //this works fine.
NSLog(@"%@", person.avatar.createdDate); //this crashes.

Tried removing the image attribute and still getting the same problem.

  • 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-11T08:12:11+00:00Added an answer on June 11, 2026 at 8:12 am

    Well, that was completely bizarre.

    I deleted the entity and re-added it… still the same problem.

    I deleted it again and added an entity called “StoredImage” instead of “Image” and it worked fine with no problems at all.

    Thanks for all the help though.

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

Sidebar

Related Questions

I have an entity called Task in my Core Data model. The Task entity
I have a rather simple data model, but I have a centric entity called
I have a core data model object called Entry. In this I have an
I have a core data model with an entity called clients that is made
I have an Entity Data Model that I have created, and its pulling in
I have an Entity Data Model-based app that uses SQL Server CE 3.5 as
I have created an entity data model and generated a database from it. One
I have a problem adding ADO.Net Entity Data Model to my existing project, or
I have an Entity Framework data model. Part of the model is a Customer
I have a vehicle entity in my data model. It has name, make, model,

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.