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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:52:30+00:00 2026-05-25T06:52:30+00:00

EveryBody.. i want to create one 8*8 dimensional array in objective c.. ( [0,

  • 0

EveryBody..

i want to create one 8*8 dimensional array in objective c..

(
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
)

like that..
And also use as one of the object can moved in it..
Like want to move

MOVE_ARRAY = array([0, 0], [0, 2])

And also check the array’s any position like 5*6 or 4*3 any..
So, Can any one help me about how to initialize , and how to use in code ?
Thanks.

  • 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-25T06:52:31+00:00Added an answer on May 25, 2026 at 6:52 am

    In Objective-C:

    array = [[NSMutableArray alloc] init];
    
    for (int i = 0; i < 8; i++) {
        NSMutableArray *subArray = [[NSMutableArray alloc] init];
        for (int j = 0; j < 8; j++) {
            [subArray addObject:[NSNumber numberWithInt:0]]; 
        }
        [array addObject:subArray];
        [subArray release];
    }
    

    (array is an instance variable, that has to be added to your header file and released in you dealloc method)

    To retrieve a value at a certain position you could write a method like this:

    - (int)valueAtRow:(int)row andColumn:(int)col {
        NSMutableArray *subArray = [array objectAtIndex:row];
        return [[subArray objectAtIndex:col] intValue];
    }
    

    === UPDATE ===

    To remove an object you could do this:

    - (void)removeObjectAtRow:(int)row andColumn:(int)col {
        NSMutableArray *subArray = [array objectAtIndex:row];
        [subArray removeObjectAtIndex:col];
    }
    

    You have to be careful though, because removing objects will change the structure of the array (e.g. the row where you removed an object will have only 7 items after the removal. So you might want to think about leaving the structure intact and set the values that you want to delete to a value that you normally don’t use:

    - (void)removeObjectAtRow:(int)row andColumn:(int)col {
        NSMutableArray *subArray = [array objectAtIndex:row];
        [subArray replaceObjectAtIndex:col withObject:[NSNumber numberWithInt:-999]];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey everybody, I want to create an app that handles some sort of recognition
HA ii everybody,i want to customize the table-view cell like the image shown below,that
Everybody knows that a list of numbers can be obtained with range like this;:
Heyy Everybody! I am trying to create a memory management system, so that a
I want to do a select in MySql that combines several columns... something like
I'd like to use Hibernate's Criteria API for precisely what everybody says is probably
I want to create a very portable app and ideally everybody should be able
We have a basic service that some people use but most people want their
I want to create a Website for that I am using asp.net technology,Since I
I want to create a javascript pipeline like powershell, bash (|) or f# (|>).

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.