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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:57:25+00:00 2026-06-13T05:57:25+00:00

Possible Duplicate: How do I create a multidimensional array? I’m new to programming and

  • 0

Possible Duplicate:
How do I create a multidimensional array?

I’m new to programming and objective C, so although I have found a few questions on here that discuss multidimensional arrays, I’m not quite getting what I need to do in order to build and use my own.

I need to make an array that has 16 rows and 3 columns. The array needs to accept string objects. I do not know how to create this, fill it, or access its contents. Would anyone be kind enough to break it down for me?

  • 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-13T05:57:27+00:00Added an answer on June 13, 2026 at 5:57 am

    I’d suggest you use a C-array, as an NSArray doesn’t support multiple dimensions. You could declare the array you described like this:

    NSString *stringArray[16][3];
    

    Setting and accessing any string of this array is quite straight-forward:

    stringArray[7][1] = @"Stringstringstring";
    
    NSString *string = stringArray[3][0];
    

    However, you could use an NSArray (or NSMutableArray), but that would be a bit less elegant:

    NSArray *stringArray = [NSArray arrayWithObjects:
                            [NSMutableArray array],
                            [NSMutableArray array],
                            [NSMutableArray array], nil];
    

    Those three NSMutableArrays would be the three columns of your two-dimensional array.

    Edit

    Using an NSArray, it might be easier to use a loop to fill it:

    NSMutableArray *stringArray = [NSMutableArray array];
    
    for (int column = 0; column < 3; column++)
    {
        NSMutableArray *columnArray = [NSMutableArray array];
    
        for (int row = 0; row < 16; row++)
            [columnArray addObject:[NSString stringWithFormat:@"Row %i, column %i", row, column]];
    
        [stringArray addObject:columnArray];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to create comma separated list from array in PHP? I have
Possible Duplicate: javascript multidimensional array? Hi guys I need to create an array that
Possible Duplicate: PHP : Create array for JSON I have an array like this
Possible Duplicate: Create new class from a Variable in Java I have a string
Possible Duplicate: Create an Array of the Last 30 Days Using PHP I am
Possible Duplicate: Create an alert on any view controller after Facebook request:didFailWithError: I have
Possible Duplicate: create multiple variables based on an int count Objective C Equivalent of
Possible Duplicate: How to create comma separated list from array in PHP? My array
Possible Duplicate: Transposing multidimensional arrays in PHP I have three arrays: $a = (a1,
Possible Duplicate: Create new C++ object at specific memory address? I am writing what

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.