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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:01:27+00:00 2026-05-27T17:01:27+00:00

Once an Array is initialized, in order to set value of desired position, I

  • 0

Once an Array is initialized, in order to set value of desired position, I am using

[self.appName replaceObjectAtIndex:x withObject:[self.appCell objectAtIndex: 0]];

Problem is that if I initialize appName array without objects, this array keeps empty and I must initialize it using initWithObjects and then works. Problem is that I do not know the size of an array and if I set it like:

NSMutableArray *nameArray = [[ NSMutableArray alloc] initWithObjects:@"test",@"test",@"test",@"test", nil];
self.appName = nameArray;
[nameArray release];

For example, works from 0 to 3 but from position 4 to following ones, after replaceObjectAtIndex, position has a nil value. How to solve it? Thank you

  • 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-27T17:01:28+00:00Added an answer on May 27, 2026 at 5:01 pm

    It’s a mutable array, you can add objects (to the end) and insert objects (in the middle) as well, whenever you like:

    NSMutableArray *nameArray = [[NSMutableArray alloc] init];
    [nameArray addObject:@"test"];
    [nameArray insertObject:@"another test" atIndex:0];
    [nameArray removeObjectAtIndex:1];
    

    You can do this anywhere you have a pointer to the mutable array.

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

Sidebar

Related Questions

I have an array of checkboxes that I edit at once to set up
If I iterate through an array twice, once by reference and then by value,
This is what I have: $observer = $this->getMock('SomeObserverClass', array('method')); $observer->expects($this->once()) ->method('method') ->with($this->equalTo($arg1)); But the
I have a byte array that's been initialized with 0xFF in each byte: for
I wanted to follow some excellent C++ advice of calculating the array length once
I am trying to run some tests using OPENmpi processing data in an array
Once again one of those: Is there an easier built-in way of doing things
Once I've created a variable in the immediate window in C# (VS2008), is there
Once a user starts a session (or logs in, for a registered user, to
Once again a very beginner-ish question, but here I go: I would like to

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.