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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:09:17+00:00 2026-06-05T12:09:17+00:00

i need to handling this string : # 2012 20120604 Huge Sandstorm over Saudi

  • 0

i need to handling this string :

# 2012
20120604 Huge Sandstorm over Saudi Arabia
20120527 Huge Sandstorm over niger
# 2012
20110330 Huge Sandstorm over niger
# just for the test
20110330 AHuge Sandstorm over niger
20110330 BHuge Sandstorm over niger
20110330 CHuge Sandstorm over niger
20110330 1Huge Sandstorm over niger
20110330 2Huge Sandstorm over niger
20110330 3Huge Sandstorm over niger
20110330 4Huge Sandstorm over niger
20110330 5CHuge Sandstorm over niger
20110330 6Huge Sandstorm over niger
# **********
20110330 7Huge Sandstorm over niger
20110330 8Huge Sandstorm over niger
20110330 9CHuge Sandstorm over niger
20110330 AHuge Sandstorm over niger
20110330 B10CHuge Sandstorm over niger
20110330 **CHuge Sandstorm over niger

in a UITableView with differents sections where the title will be the “# …….” and the content “20110330 ……..” “20110330 ……..” “20110330 ……..”

how can i handle this string please?

  • 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-05T12:09:18+00:00Added an answer on June 5, 2026 at 12:09 pm

    Try this thing.

    NSString *str = @"above string"; //load above string here
    NSArray * firstArry = [str componentsSeparatedByString:@"#"];
    NSMutableArray *secondArry = [[NSMutableArray alloc] init]; //Will hold the # titles
    NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; //Will hold the strings related to # title
    for(NSString firstArryStr in firstArry)
      {
          NSArray *tempArry = [firstArryStr componentsSeparatedByString@"\n"];
          NSMutableArray *titleStingsArry = [[NSMutableArray alloc] init];
          for (int i=0; i< [tempArry count];i++) {
                if (i==0) {
                    NSString *title = [tempArry  objectAtIndex:i];
                    [secondArry addObject:title];
                    [dict setValue:titleStingsArry  forKey:title];
                } else {
                    [titleStingsArry  addObject:[tempArry  objectAtIndex:i]];
                }
          } 
      }
    

    Now you have secondArry for section and dictionary of array for rows in sections.

    P.S. Please ignore syntax error as I’m not using mac machine right now and take care of memory management also.

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

Sidebar

Related Questions

I'm running into this situation where I need to parse a String into an
I need to know witch of this two handling of exceptions is better and
I need to implement handling of redelivery of JMS messages in the application that
I need a little help creating a catch-all error handling page in my ICEfaces
I need to some extra functionalities to a website regarding image handling. The user
I need to be able to move the mouse around while I am handling
I need to know, whether extjs 3.1 is available of exception handling and logging
How can I check whether a string represents a long, a double, or just
need to implement a global error handling, so maybe you can help out with
I have a list of integers which I need to parse into a string

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.