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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:16:04+00:00 2026-05-19T04:16:04+00:00

I’m really new to programming in Objective-C, my background is in labview which is

  • 0

I’m really new to programming in Objective-C, my background is in labview which is a graphical programming language, I’ve worked with Visual Basic some and HTML/CSS a fair amount as well. I’m trying to figure out the logic to create an array of data for the pattern below. I need the pattern later to extract data from another 2 arrays in a specific order.

I can do it by referencing a = 1, b = 2, c = 3 etc and then creating the array with a, b, c but I want to use a loop so that I don’t have 8 references above the array. These references will be used to generate another generation of data so unless I can get help figuring out the logic I’ll actually end up with 72 references above the array.

// This is the first one which gives the pattern

0 0 0 0 (etc) // 1 1 1 1 // 2 2 2 2

NSMutableArray * expSecondRef_one = [NSMutableArray array];

int a1 = 0;
while (a1 < 9) {
    int a2 = 0;
        while (a2 < 8) {
            NSNumber * a3 = [NSNumber numberWithInt:a1];
            [expSecondRef_one addObject:a3];
            a2++;
        }
    a1++;   
}

// This is the second one which I’m stumbling over, I am looking for the pattern

1 2 3 4 5 6 7 8 //
0 2 3 4 5 6 7 8 //
0 1 3 4 5 6 7 8 //
0 1 2 4 5 6 7 8 // etc to -> // 0 1 2 3 4 5 6 7

If you run it in a line every 9th number is -1 but I don’t know how to do that over a pattern of 8.

Thanks in advance!

Graham

  • 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-19T04:16:04+00:00Added an answer on May 19, 2026 at 4:16 am

    I think you’re looking for something like :

    for(int i = 0; i < 9; ++i) {
      for (int j = 0; j < 8; ++j) {
        if (j < i) {
          //Insert j into array
        }
        else {
          //Insert j + 1 into array
        }
      }
    }
    

    I left out the code to actually insert the numbers into the array.

    I’m not totally clear on how you’re using this array, but if this is just an order of indexes to access data from another group of arrays, you may be able to skip the first set of arrays and just use this loop to access your data later.

    –edit–

    If I’m understanding you correctly, you want to compare each index in an array of 9 numbers to every other index, then store the results in an array. If that’s the case, you could just do something like this:

    for (int i = 0; i < 9; ++i) {
      for (j = 0; j < 9; ++j) {
        if (j != i) {
          //Compare object at array index i with object at array index j
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into

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.