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

The Archive Base Latest Questions

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

first,i need to count the items from array. <dict> <key>New item</key> <array> <string>apple</string> <string>orange</string>

  • 0

first,i need to count the items from array.

<dict>
    <key>New item</key>
    <array>
        <string>apple</string>
        <string>orange</string>
    </array>
</dict>

second,load the items into tableview.example,table cell 1 with apple,table cell 2 with orange.
third,create buttons in table cell by count items from array.
fourth,set buttons title with items value.example,button”apple” and button”orange”.

where should i start from?

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

    Start with creating a retained property that will be your UITableView’s data source.

    in .h file

    @property (strong, nonatomic) NSArray *dataSource; //use retain instead of strong if not using ARC
    

    Next extract the array from dictionary into your data source

    self.dataSource = [dict objectForKey:@"New item"]; //only if it's guaranteed that the dictionary contains that array
    

    Next implement your table view’s data source protocol with two methods:

    - (NSInteger)tableViewNumberOfRowsInSection:(UITableView *)tableView {
      return dataSource.count; // create cells by count of array
    }
    
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath)indexPath {
      static NSString *reuseIdentifier = @"fruit";
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
      if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]; // add autorelease if not using ARC
        //add your UIButton here, give it tag
        UIButton *button = ...;//alloc the button and give it proper frame and add it as cell's subview
        [cell.contentView addSubview:button];
        button.tag = 5;
      }
      //extract the button and give it title
      UIButton *button = (UIButton *)[cell viewWithTag:5];
      button.title = [dataSource objectAtIndex:indexPath.row];
      return cell;
    }
    

    So you must learn about delegation and what protocols are. Read the UITableView programming guide for more information.

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

Sidebar

Related Questions

String[] a = c.toArray(new String[0]); First: Do I need type cast here? (I think
I need to get just the first item (actually, just the first key) off
I need to repeatedly remove the first line from a huge text file using
I need to set/get the cookies stored at first.example while browsing second.example , I
select first name ,last name ,employeeID ,CASE WHEN CONVERT(xml,detail).value('count(//education/item)','nvarchar(50)')=0 AND CONVERT(xml,detail).value('(//preventive/itemValue/text())[1]','nvarchar(50)') LIKE '%Employee refuses
A bunch of key/value pairs, from an object that may have duplicate keys, need
I'm working with jQuery for the first time and need some help. I have
I have an application that when it first starts i need it to run
I am climbing the java learning curve, and for the first time I need
I need to get the first and last day of a month in the

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.