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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:25:13+00:00 2026-05-25T19:25:13+00:00

Whats design pattern does UITableView use to populate and what are the benefits? Is

  • 0

Whats design pattern does UITableView use to populate and what are the benefits?
Is it delegate pattern? Reason I am asking is that it’s not just delegate but the datasource as well.Seems more like along the line with MVC.

I have just gone through a couple of tutorials online their\my code is working but it looks like I am missing the point.I end with all these methods in my main controller.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;//any number based on datasource size.
}

// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
    }

    // Set up the cell...
    cell.text = [names objectAtIndex:indexPath.row];//names is an array.
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
}

It is a view based application . Should it be in a sperate controller.Otherwise it just looks messy and over the top way of doing something simple. I am not at all saying Objective C or apple is wrong but just that I am a beginner and missing the whole point of this delegate and datasource setup.

so to summarise can someone please explain:

1-Whats the benefit of this delegate and datasource setup?
2-Whats the name of this design pattern?
3-Should I have a separate controller (in view based application)?

  • 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-25T19:25:13+00:00Added an answer on May 25, 2026 at 7:25 pm
    1. In Apple’s parlance, delegate implements call-back methods which modify the UI behavior, and dataSource provides the data. In a bigger app, you can use two different objects to be the delegate and the data source separately.

    2. I’m not familiar with the official terminology, sorry …

    3. Depends on the size of your app. Even if you just use appDelegate for everything, it’s recommended to add

       #pragma mark -- table view delegate methods
       ...methods...
       #pragma mark -- table view data source methods
       ...more methods...
      

      so that the method list is shown nicely inside Xcode.

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

Sidebar

Related Questions

Whats the best design pattern to use for LINQ and type tables that exist
I have come across a website that appears to use Ajax but does not
Does such design pattern exists? It is similar but opposite to a factory pattern.
What is a design pattern I can use for generating context-sensitive right click menus
The Receptionist Pattern is a design pattern that provides a way to redirect an
I fully realize that what I am proposing does not follow the .NET guidelines,
After reading on the benefits (and using) the Repository Design pattern within an ASP.NET
I'm looking for some thoughts on which design pattern(s) to use for my problem,
What is the Action Design Pattern, I haven't heard of it before? I am
What is the difference between applying the visitor design pattern to your code and

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.