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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:45:37+00:00 2026-05-13T07:45:37+00:00

How to insert items into NSArray object in C# (Monotouch)? I don’t find appropriate

  • 0

How to insert items into NSArray object in C# (Monotouch)? I don’t find appropriate method to do so? In Objective-C side, there is a constructor called “initWithObjects” but I don’t find this on C# side.

pom

  • 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-13T07:45:37+00:00Added an answer on May 13, 2026 at 7:45 am

    Sorry to answer your question with a question, but are you sure you want to create an NSArray?

    I ask because MonoTouch does some work behind the scenes so that you don’t have to deal with NSArray.

    If you go to the MonoTouch API Design page and do an in-page search for “NSArray”, you’ll find this:

    Instead of dealing with NSString and NSArray the runtime instead exposes these as C# strings and strongly typed arrays throughout the API.

    In other words, unless you have a specific reason to, you don’t have to mess with NSArray.

    But, if you do have a reason, or if it’s your preference, then Jason’s answer is correct:

    NSArray someArray = NSArray.FromNSObjects(thingOne, thingTwo, thingThree);
    

    The only thing I’d add is that, if you’re an Objective-C dev and giving MonoTouch a try, you’re used to this:

    NSArray *someArray = [NSArray arrayWithObjects:obj1, obj2, obj3, nil];
    

    The difference is the “nil” at the end of the Objective-C version. MonoTouch’s NSArray doesn’t have this same requirement. You just pass it the objects you want it to contain, and it happily does so. No terminating null required 🙂

    Hope this helps…

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

Sidebar

Related Questions

I have a form that allows users to insert items in a database. A
my goal is to select items from a table and append those items into
I am trying to find the most efficient way of running multiple (> 1000)
I have a list table with 5 entries in it, the first column in
I have three queries that I'm running through SQLite. These are what I'm running;
I have an image upload script, originally I kept it in a file called
I have an activity for initialising a game, that does multiple selects and inserts
In learning WPF, I (perhaps unwisely) chose to display my XML data (wisely parsed
I am writing a generic hash map in C++ which uses chaining to deal
I am new to Mongo DB I have to implement it in java. I

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.