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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:24:46+00:00 2026-06-14T11:24:46+00:00

I am trying to archieve ns mustable array with images, my code looks like:

  • 0

I am trying to archieve ns mustable array with images, my code looks like:

//in my .h file I have
#define kName @"name"
#define kEmail  @"email"
#define kPhone  @"phone"
#define kDetail @"detail"
#define kImages @"images"
#define kRequestDate  @"requestDate"
#define kRequestSent @"status"

@interface BAPRequest : NSObject
@property (nonatomic) NSString *name;
@property (nonatomic) NSString *email;
@property (nonatomic) NSString *phone;
@property (nonatomic) NSString *detail;
@property (nonatomic) NSMutableArray *images;
@property (nonatomic) NSDate *requestDate;
@property (nonatomic) BOOL requestSent;
@end

//in my .m file I have
#import "BAPRequest.h"

@implementation BAPRequest

@synthesize name, email, phone, detail;
@synthesize images;
@synthesize requestDate;
@synthesize requestSent;

- (void)encodeWithCoder:(NSCoder *)encoder{
  [encoder encodeObject:name forKey:kName];
  [encoder encodeObject:email forKey:kEmail];
  [encoder encodeObject:phone forKey:kPhone];
  [encoder encodeObject:detail forKey:kDetail];
  [encoder encodeObject:images forKey:kImages];
  [encoder encodeObject:requestDate forKey:kRequestDate];
  [encoder encodeBool:requestSent forKey:kRequestSent];
}

- (id)initWithCoder:(NSCoder *)decoder{
  name = [decoder decodeObjectForKey:kName];
  email = [decoder decodeObjectForKey:kEmail];
  phone = [decoder decodeObjectForKey:kPhone];
  detail = [decoder decodeObjectForKey:kDetail];
  images = [decoder decodeObjectForKey:kImages];
  requestDate = [decoder decodeObjectForKey:kRequestDate];
  requestSent = [decoder decodeBoolForKey:kRequestSent];
  return self;
}
@end

of course I also have the NSKeyedArchiver codes as well just like everyone else.

Everything else does archive properly, when I save then load them, it seems all working.

But archiving images seems not.

I do have a MutableArray archiving each BAPObjects as well before archive, wonder is it because ios doesn’t support archiving MutableArray inside MutableArray or is it just because I can’t archive images easily?

Cheers
Phil

  • 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-14T11:24:47+00:00Added an answer on June 14, 2026 at 11:24 am

    to archive an image dont use

    Instead convert the UIImage to NSData representations using by using
    UIImageJPEGRepresentation or UIImagePNGRepresentation.

    Then archive the NSMutableArray

    Edit:
    You will have to replace the items that you want to save in the NSMutableArray with NSData

    NSData *imageData = UIImagePNGRepresentation([your_array objectAtIndex:0]);
    

    Replace the the UIImage with the imageData

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

Sidebar

Related Questions

im trying to achieve the following, in php i have a form like this:
I am trying to create a multiple choice test app. I have this code
I have a IKImageBrowserView embedded inside an NSScrollView. I'm trying achieve scroll bars like
I trying to achieve something like as below :- <%= link_to <%= user.email %>,
I'm trying to achieve ajax-like-file-upload-using-hidden-iframe . Obviously there are many plugins available for that
im trying to achieve something but i dont really know how I have set
What I am trying to achieve is editing code in vim then running make
I am trying to achieve something like this. The Expandable List consists of the
I am trying to create a layout that will looking like: +---+--------+---+ | |
Im trying to achieve an output like this {status:ok,0:{id:11,title:digg,url:http://www.digg.com}} but instead i am getting

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.