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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:32:24+00:00 2026-06-13T12:32:24+00:00

Possible Duplicate: Is there any way to enforce typing on NSArray, NSMutableArray, etc.? I’m

  • 0

Possible Duplicate:
Is there any way to enforce typing on NSArray, NSMutableArray, etc.?

I’m Java programmer and I’m starting on Obj-C, in java i can create a mutable array with determined type of class, like as follow:

ArrayList<MyClass> list;

in Obj-c I know the NSMutableArray but i don’t know and not found how to determinate the type of class into it.

Have a way of make this with it or other class without NSMutableArray which can do this?

Thanks a lot.

  • 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-13T12:32:26+00:00Added an answer on June 13, 2026 at 12:32 pm

    No, Cocoa/Objective-C doesn’t offer typed collections like this. All objects in the collection must inherit from NSObject (which is basically everything besides primitives and structs), but beyond that, it’s up to you to understand/manage what is going on in the array. Objects in an NSMutableArray are represented in its interface by the generic type id.


    From a design standpoint, collections in Cocoa typically do contain homogeneously-typed objects. The name of the array is often used to indicate what’s inside it (just as in Java), e.g. bookTitlesArray or just bookTitles (i.e. strings). Additionally, from an abstraction standpoint, sometimes lightweight classes are used to “wrap” a raw NSMutableArray to enforce type checking at the interface. As in, a new class called BookTitleList which offered a subset of the add, lookup, remove methods and passed them through to an internal array after e.g. validation. But YMMV depending on your needs.

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

Sidebar

Related Questions

Possible Duplicate: Java REPL shell Hey, Is there any way to execute Java code
Possible Duplicate: Java Regex Replace with Capturing Group Is there any way to replace
Possible Duplicate: Using java to create a web browser Is there any way to
Possible Duplicate: Is there any way to determine text direction from CultureInfo in asp.net?
Possible Duplicate: Any way to “reboot” the JVM? Is there any option to restart
Possible Duplicate: Objective C for Windows iPhone development on Windows Is there any way
Possible Duplicate: Porting VB.NET Winforms Application to C# Is there any way to convert
Possible Duplicate: Overriding the power button in Android Is there any possible way I
Possible Duplicate: Any way to add HttpHandler programatically in .NET? Is there a way
Possible Duplicate: Is there any way to know if the value of an argument

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.