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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:56:06+00:00 2026-06-14T18:56:06+00:00

I have array of element like this Cosmetics~Sample~test1, Cosmetics~Sample~test2, i need to display like

  • 0

I have array of element like this

"Cosmetics~Sample~test1",
"Cosmetics~Sample~test2",

i need to display like this

cosmetics –sample –> test1,test2 (its like cosmetics as main and cosmetics sub will be Sample and Sample sub have test1 and test2 element) like branch

 NSArray * seperate=[[NSArray alloc]init];
for (int i =0; i < jsonarray.count; i++) {
    NSString *sam=[[jsonarray valueForKey:@"category"]objectAtIndex:i]; 
    seperate=[sam componentsSeparatedByString:@"~"];       
    [cellarray addObject:[seperate objectAtIndex:0]];
}

I have done separating those with ~ mark but i cant compare those and form like i mentioned.. Help Pls…

  • 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-14T18:56:07+00:00Added an answer on June 14, 2026 at 6:56 pm

    Merger two array without duplication maintaing order like this:

    NSArray *a= [NSArray arrayWithObjects:@"Cosmetics",@"Sample",@"test1", nil];
    NSArray *b= [NSArray arrayWithObjects:@"Cosmetics",@"Sample",@"test2", nil];
    NSMutableOrderedSet *setA = [NSMutableOrderedSet orderedSetWithArray:a];
    NSOrderedSet *setB = [NSOrderedSet orderedSetWithArray:b];
    [setA unionOrderedSet:setB];
    NSLog(@"Merged One : %@", [[setA array] componentsJoinedByString:@" "]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Zend_Form with file element like this: ->addElement('file', 'image', array( 'required' =>
I have array $arr=array(a=>array(b=>123)) and I need to do with it something like this:
I have an array with each element is a string like this: $items[0] =
how i can duplicate one element from array: for example, i have this array:
If I have an array created like this: MyType *array = new MyType[10]; And
I will have a string like this: Bob is a boy. Bob is 1000
I have a multidimensional array that looks like this: Array ( [0] => Array
I have created an element like this: var myDiv = new Element('div'); myDiv.update('Hello!'); I
Suppose I have an element like this: <div id=dv class=red green blue>Something Here !!</div>
i have an array like this: NSArray *arr = [[NSArray alloc]initWithObjects:@1,@2,@3,@4,@5,@6,nil]; how i can

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.