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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:04:47+00:00 2026-06-04T06:04:47+00:00

Okay, so I want to do something like this: int array[] = {1, 2,

  • 0

Okay, so I want to do something like this:

int array[] = {1, 2, 3, 4, 5};

How would I go about that if I want to use NSArray and NSNumbers instead of ints?

**Note:

I do not want something like

NSMutableArray *array = [[NSMutableArray alloc] init];
[array addObject: ];

I need to be able to put them all in a single set separated by a comma. (Weird but it makes my program easier to handle in that format. I’m mimicking some java code where that is done a lot, so itl make it easier to follow the tutorial.)

  • 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-04T06:04:49+00:00Added an answer on June 4, 2026 at 6:04 am

    If you want to add all the elements at once, and you’re not going to change it, then us an NSArray. You can fill it like this:

    NSArray *array = [NSArray arrayWithObjects:[NSNumber numberWithInt:1],[NSNumber numberWithInt:2],[NSNumber numberWithInt:3],[NSNumber numberWithInt:4],[NSNumber numberWithInt:5],nil];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay what I want to do is something like this. |--> Child 1 (Parent=Root
Okay, so I need something like this: time_span = 1.month date = DateTime.now date
Or is it okay to do something like this: new Thread( new ThreadStart( delegate
Feel like this should be something easy that I'm missing. I have a table
I've got an rdlc report with a data source that provides something like this:
Let's say that I have the methodInfo for something like Nullable<int>.HasValue . Is there
Following Problem: I need something like an empty scope. Which means that this scope
Okay so I want to make an application that launches other applications. However, the
Okay, so I have a UITableView that I want to apply themes to. I
okay...im really puzzled with this. I want to create a regular asp.net webforms website

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.