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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:27:40+00:00 2026-06-07T01:27:40+00:00

In my application NSMutableArray comes like this, Activity:( 0-1, 2-4, 3-5, 1-2 ) I

  • 0

In my application NSMutableArray comes like this,

 Activity:(
"0-1",
"2-4",
"3-5",
"1-2"
)

I want data in NSMutableArray Like,

Activity:(
"1",
"4",
"5",
"2"
)

Please, Any one suggest me how can i do that?

  • 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-07T01:27:41+00:00Added an answer on June 7, 2026 at 1:27 am

    First of all I agree with Richard’s comment.
    Also, it’s a bad habit naming your ivars capitalized.
    That said, you can accomplish what you need with something like this:

    NSMutableArray *cleanArray = [[NSMutableArray alloc] initWithCapacity:0];  
    
    // Here 'Activity' is your NSArray. A better name would be 'activity'
    // (save capitalized names for classes)
    for (NSString *item in Activity)
    {
        [cleanArray addObject:[[item componentsSeparatedByString:@"-"] lastObject]];
    }
    

    And now you got an array with the substrings after the ‘-‘ so you could just replace your original array with the new one.

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

Sidebar

Related Questions

I am developing one application. In that iam using the NSMutableArray for storing the
Possible Duplicate: What's the Best Way to Shuffle an NSMutableArray? iam developing one application.In
Application : HTA (therefore IE) This is an application that uses SendKeys to populate
i want to create an application in one row of tableView there will be
I'm a newbie iOS developer. I wrote a small application that save an NSMutableArray
I have a Tabbar - Application and i want to show data (NSString) from
I've made a NSMutableArray for the EKCalendars that my application uses. On the first
For a little iPhone application I am making, I want to sort a NSMutableArray.
I have a tabBar application. In the app delegate i create one NSMutableArray, one
I am creating one application in iOs 5 using story board and in that

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.