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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:18:46+00:00 2026-06-05T06:18:46+00:00

In the Model portion, I have some data types whose properties are all property

  • 0

In the Model portion, I have some data types whose properties are all property list data types. Eventually, users will be sending each other these data items over the network by posting to and reading from a server. The question is, should I be using NSCoding and NSKeyedArchiver (as in the second code block below, which makes ugly XML IMHO) or should I do something like subclass NSDict so I can use dictionaryWithContentsOfFile: and writeToFile:atomically: to get pretty XML?

@interface Word : NSObject <NSCoding>
@property (strong, nonatomic) NSString *language;
@property (strong, nonatomic) NSString *name;
@property (strong, nonatomic) NSDictionary *detail;
@property (strong, nonatomic) NSString *userName;
@property (strong, nonatomic) NSString *userId;
@property (strong, nonatomic) NSArray *files;
- (void)copyFromTemporaryFiles:(NSArray *)temporaryFiles; // populates self.files
@end

and

@interface Category : NSObject <NSCoding>
@property (strong, nonatomic) NSString *name;
@property (strong, nonatomic) NSDictionary *detail;
@property (strong, nonatomic) NSDate *updated;
@property (strong, nonatomic) NSArray *words;
+ (Category *)categoryWithName:(NSString *)name;
- (void)saveWithName:(NSString *)name;
@end
  • 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-05T06:18:48+00:00Added an answer on June 5, 2026 at 6:18 am

    In my opinion, neither of these options is a great practice for sending data over a network since the file sizes will be relatively large compared to other formats. Instead, I would probably use a JSON library to transmit this sort of structured data. If you’re building for iOS 5+, you can look into NSJSONSerialization (reference here) to do some simple, straightforward conversion (just pack up all your ivars in a dictionary and pass it to +dataWithJSONObject:options:error, send the data over the network, and unpack with +JSONObjectWithData:options:error). Otherwise, there’s a bunch of 3rd party and/or open source solutions out there. SBJSON comes immediately to mind.

    P.S. I would really be wary of subclassing NSDictionary. The class actually represents a class-cluster and has a bunch of optimization going on the background to handle best use of memory, etc. You can read the Subclassing Notes on the reference page to find some other means of adding functionality to your dictionaries.

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

Sidebar

Related Questions

I'm reading some code of a model malloc (allocateMemory). I have posted a portion
I have a portion of a table whose values depend on the value in
I have some legacy code that provides a list of the available COM ports
I have a model with some fields. I have a model form that represents
needing some help to just break down the problem. I have new users who
i have a model with all the fields about user info. and with crud
I'm having some trouble with replacing a portion of a file in binary mode.
My model has a object which has a date property... [Required(ErrorMessage={0} is required)] [Display(Name=Donation
I have a job model which has many attributes. I would like to use
I am looking into the security model of Tomcat and have a question regarding

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.