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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:22:40+00:00 2026-05-13T17:22:40+00:00

I built a simple mac data entry tool I use with an iPhone application.

  • 0

I built a simple mac data entry tool I use with an iPhone application. I’ve recently added thumbnail which I added via an Image Well using simple bindings. Its a transformable data type which seems to work fine.

The iPhone application however won’t show the images. The attribute isn’t null but I can’t get an image to appear. The following is for cellForRowAtIndexPath

static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}

NSManagedObject *entity = nil;
if ([self.searchDisplayController isActive])
    entity = [[self filteredListContent] objectAtIndex:[indexPath row]];
else
    entity = [fetchedResultsController objectAtIndexPath:indexPath];
cell.textLabel.text = [entity valueForKey:@"name"];
//cell.imageview.image = [UIImage imageNamed:@"ImageB.jpeg"]; //works fine
cell.imageView.image = [entity valueForKey:@"thumbnail"];//no error, but no file

return cell;

I’m thinking either the problem is with the transformable (I’m using the default NSKeyedUnarchiveFromData), or how I’m calling the thumbnail. I’m a newbie so any help would be greatly appreciated.

  • 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-13T17:22:41+00:00Added an answer on May 13, 2026 at 5:22 pm

    Sounds like you are storing the image as an NSImage on the desktop and that object does not exist on the iPhone. Your desktop app needs to store the image in something that is portable, a PNG or JPG, etc. Then you will be able to load it back into your iPhone application as a UIImage.

    Update re transformable

    Sounds like you are still passing in a NSImage to the attribute and it is thinking you are handling it data. You need to convert it to a “standard” format first, like this:

    NSBitmapImageRep *bits = [[myImage representations] objectAtIndex: 0];
    
    NSData *data = [bits representationUsingType:NSPNGFileType properties:nil];
    [myManagedObject setImage:data];
    

    I recommend writing custom accessors to handle this, like the following:

    #ifdef IPHONEOS_DEPLOYMENT_TARGET
    
    - (void)setImage:(UIImage*)image
    {
      [self willChangeValueForKey:@"image"];
    
      NSData *data = UIImagePNGRepresentation(image);
      [myManagedObject setImage:data];
      [self setPrimitiveValue:data forKey:@"image"];
      [self didChangeValueForKey:@"image"];
    }
    
    - (UIImage*)image
    {
      [self willAccessValueForKey:@"image"];
      UIImage *image = [UIImage imageWithData:[self primitiveValueForKey:@"image"];
      [self didAccessValueForKey:@"image"];
      return image;
    }
    
    #else
    
    - (void)setImage:(NSImage*)image
    {
      [self willChangeValueForKey:@"image"];
      NSBitmapImageRep *bits = [[image representations] objectAtIndex: 0];
    
      NSData *data = [bits representationUsingType:NSPNGFileType properties:nil];
      [myManagedObject setImage:data];
      [self setPrimitiveValue:data forKey:@"image"];
      [self didChangeValueForKey:@"image"];
    }
    
    - (NSImage*)image
    {
      [self willAccessValueForKey:@"image"];
      NSImage *image = [[NSImage alloc] initWithData:[self primitiveValueForKey:@"image"]];
      [self didAccessValueForKey:@"image"];
      return [image autorelease];
    }
    
    #endif
    

    This will give you a conditional compile and will store the data as NSData (in PNG format) that can be retrieved on any device.

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

Sidebar

Related Questions

Hi I have built a simple WCF application I am using to query data
I want to create a simple Mac application bundle which calls a simple Python
I've built a simple sign in POST form that gets submitted via AJAX (default
I was trying to make a simple Mac Objective-C application with Xcode to keep
I built a simple social community website for a client - the client would
I built this simple script to input a certain number, Now I want to
I've built a simple customized view and registered onClickListener() in a constructor. To start
I have built a simple TCP server and need to compare client input with
I have built a simple menu in jQuery http://vanquish.websitewelcome.com/~toberua/ Here is a sample of
I've built a simple cms with an admin section. I want to create something

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.