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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:01:12+00:00 2026-06-04T15:01:12+00:00

im working on application that have search view, the search view contain a tableView

  • 0

im working on application that have search view,
the search view contain a tableView with 3 sections – i implement the section manually by

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 
{
    // Return the number of sections.
    return 3;
}


- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{

    if (section == 0){
        UITextField *title = [[UITextField alloc]initWithFrame:CGRectMake(0, 0, 320, 10)];
        [title setBackgroundColor:[UIColor lightGrayColor]];
        [title setTextAlignment:UITextAlignmentRight];
        [title setFont:[UIFont boldSystemFontOfSize:15]];
        [title setText:@"videos"];
        return title ;
    }
    if (section == 1){
        UITextField *title = [[UITextField alloc]initWithFrame:CGRectMake(0, 0, 320, 10)];
        [title setBackgroundColor:[UIColor lightGrayColor]];
        [title setTextAlignment:UITextAlignmentRight];
        [title setFont:[UIFont boldSystemFontOfSize:15]];
        [title setText:@"documents"];
        return title ; 
    }
    if (section == 2){
        UITextField *title = [[UITextField alloc]initWithFrame:CGRectMake(0, 0, 320, 10)];
        [title setBackgroundColor:[UIColor lightGrayColor]];
        [title setTextAlignment:UITextAlignmentRight];
        [title setFont:[UIFont boldSystemFontOfSize:15]];
        [title setText:@"questions"];
        return title ; 
    }
}

now, all my data received with XML that looks like this:

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"> 
<channel>
    <title>documents</title>
        <item>
        <title>how to count the days</title>
        <link>some link...</link>
        <date>11/09/2007 16:45:00</date>
        <SupplierName>roei</SupplierName>
        <CategoryName>the omer</CategoryName>

      </item>

        <item>
        <title>research</title>
        <link>some link...</link>
        <date>16/05/2010 13:41:00</date>
        <SupplierName>eran</SupplierName>
        <CategoryName>shavoot</CategoryName>
      </item>

</channel>

<channel>
    <title> video </title>
                <item>
                <title>the end of holiday</title>
                <link>some link...</link>
                <date>06/06/2011 08:56:00</date>
                <SupplierName>dina</SupplierName>
                <CategoryName>shavoot</CategoryName>

              </item>

                <item>
                <title>bible</title>
                <link>some link...</link>
                <date>24/05/2012 10:00:00</date>
                <SupplierName>amir</SupplierName>
                <CategoryName>shavoot</CategoryName>        
              </item>

</channel>



        <channel>
            <title>questions</title>

                <item>
                <title>questions for shavvot</title>
                <link>some link...</link>
                <date>28/10/2008 13:31:00</date>
                <SenderName>אלי.ד.</SenderName>
                <CategoryName>holidays</CategoryName>
              </item>

                <item>
                <title>Shavoot</title>
                <link>some link...</link>
                <date>25/05/2008 01:01:00</date>
                <SenderName>amir</SenderName>
                <CategoryName>holidays</CategoryName>
              </item>


        </channel>


</rss>

as you can see- i have title with the names of the sections, but how should i determine the correct sections for the cells ?
im parsing all the data to one array and then getting it out using dictionary:

NSDictionary *object = [ResultsArrayDisplay objectAtIndex:indexPath.row];

please help me, im after few hours of tries with nothing helpful in the internet so far.

  • 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-04T15:01:13+00:00Added an answer on June 4, 2026 at 3:01 pm

    This is your problem:

    im parsing all the data to one array and then getting it out using
    dictionary:

    Put the data for each section in its own array then use indexPath.section to determine which array to use. For each section it will give you rows for that section only so you can use the indexPath.row to index into each of your arrays.

    If you insist on keeping everything in one array, then you will have to maintain a count of how many of each type you have and then use that to figure out which array index you need.

    In either case be sure to implement numberOfRowsinSection:. If you’re using multiple arrays then this will just be the array count for that section otherwise it will be the portion of your main array that is used in that section.

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

Sidebar

Related Questions

I am working on splitting out an existing, working application that I currently have
I'm working on an application that will have attachments, and I would like to
I'm working on a web application that will have a custom UI for the
Now that I have a read-only application working, I am working on the insert
I have an application that is working as a proxy using QTcpSocket to intercept
I have been working on a BlackBerry application that consumes web services from ColdFusion
I have am working on a web application that makes use of helper classes.
I have a .net application that is not working on a colleagues computer (he
I have a Core Data based mac application that is working perfectly well until
I am thinking of working on a Rails application that uses PostgreSQL. I have

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.