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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:44:17+00:00 2026-06-05T11:44:17+00:00

I have some structs that I want to use for different purposes in my

  • 0

I have some structs that I want to use for different purposes in my application. My application needs to define different NSArrays based on each of these structs. Problem is that NSArray doesn’t work with structs so I read that I should use classes as objects for NSArray.

Now my classes ( now I will use classes for these structs) are supposed to have just some basic integers and strings and I only need @property probably with them and I don’t want to have a lot of .h and .m files in my project each for different class. Is there a way that I can just have one external class and define others as part of it or have all these class definitions in just one pair of .h and .m file? All of these class definitions will be mutually exclusive in functionality.

  • 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-05T11:44:19+00:00Added an answer on June 5, 2026 at 11:44 am

    Yes. You can have many @interface blocks in a .h file, and many @implementation blocks in a .m file.

    // DataTypes.h
    
    @interface Type1 : NSObject
    
    @property (copy) NSString *name; // for example
    // more properties
    
    @end
    
    @interface Type2 : NSObject
    
    // more properties
    
    @end
    

    .

    // DataTypes.m
    
    @implementation Type1
    
    @synthesize name;
    
    @end
    
    @implementation Type2
    
    // etc.
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have done some learning on struts based on one project that i got.Now
I have some arbitrary pixel data that I want to save as a PNG.
I have a query which retrieves Some data. I want to display that data
I have some read-only data that I want to initialise and then re-initialise periodically
My application is written in C. I have a module that uses some data
Recently I've been working on some embedded devices, where we have some structs and
I'm studying .NET structs - some books advise creating structs if they have an
I have some text lines like that : vt_wildshade2^508^508 vt_ailleurs2^1188^1188 ... vt_high2^13652^13652 Is it
How to pass by ref different types of objects that have the same properties
I have a requirement to create some xml structs (to borrow a C-phrase) in

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.