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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:15:26+00:00 2026-05-19T03:15:26+00:00

Objective-C/iPhone beginner here…looking for a shove in the right direction. I need to create

  • 0

Objective-C/iPhone beginner here…looking for a shove in the right direction.

I need to create an array that will later be stored using CoreData. In reality this is best described as an n x m matrix. Each row being a record. All data is integer.

something like this:

struct record
{
 int index;
 int mode;
 int counter;
};

struct record database[20];

I am paraphrasing here. This isn’t a database application. The matrix in question holds the data necessary to run a state machine. But, you get the idea. A bunch of rows of integers.

What’s the best O-C approach to this, considering that I need to save the matrix to the file system.

Can I use an NSArray of structs? (I don’t think NSArray likes non-object types).

NSArray of NSArray’s?

NSArray of NSDictionary?

Thank you,

-Martin

  • 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-19T03:15:26+00:00Added an answer on May 19, 2026 at 3:15 am

    You are correct. NSArray only accepts objects that inherit from NSObject. Because of this, you can use an array of NSArrays, or convert your struct to an object that inherits from NSObject and store that in the array instead. The bonus for this is that you (may?) be able to use an NSManagedObject which you could then integrate nicely with core data.

    Bear in mind that Core Data is an object graph, not a database. Because of this, you may want to start from that side, instead of designing your objects then trying to fit them into a relational database.

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

Sidebar

Related Questions

Hi I'm looking into iPhone development, and Objective-C is not be my preferred language.
I'm a beginner with Objective C and iPhone development. It's there any way to
I'm new to Objective-C and iPhone development, and I'm trying to store floating-point values
How would I expose an Objective-C method within JavaScript when using the iPhone SDK
I am currently working on an iPhone 2.1 application. I am new to Objective
The Objective Caml language will only produce stack traces if you ask for them
My objective here is really simple -- I'm trying to set an NSString to
I m the beginner in iphone software development. I want to make my own
I m the beginner in iphone Thanks for sending me answer.... I want to
Objective-C has no namespaces; it's much like C, everything is within one global namespace.

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.