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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:26:34+00:00 2026-05-13T15:26:34+00:00

The formulation of the question may be confusing. I do understand why it is

  • 0

The formulation of the question may be confusing. I do understand why it is useful for a method like cellForRowAtIndexPath to receive a pointer the relevant UITableView.

What I don’t understand is more Objective-C wise: I would like to put a name on is this special way of declaring methods?

Like if an object (e.g. UITableView) that have some internal protocol (e.g. UITableViewDataSource) would send messages to the implementers using a special way of referencing itself.

I.E. Instead of passing a reference to itself as a regular Objective-C message argument, the UITableView is using that special syntax?

  • 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-13T15:26:35+00:00Added an answer on May 13, 2026 at 3:26 pm

    Edit

    There’s quite a long discussion in the comments to this answer, which refined the original question. I’ll post the salient points here to help others who may have similar questions.

    It boiled down to a confusion between two methods,

    - (UITableViewCell *)cellForRowAtIndexPath:(NSIndexPath *)indexPath;
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
    

    The first method is an instance method of UITableView which returns a UITableViewCell for a given index path. This method is called on a table view object.

    The second method is a datasource method declared in the UITableViewDataSource protocol that asks for a UITableViewCell for a given index path.

    The important difference is that the first is called on a table view instance by any class that may want a reference to a table cell, and the second is called by a table view instance on a data source class to ask for a cell to display at the given index path.

    I hope this helps.


    Most delegate/datasource protocols in Cocoa/Cocoa Touch follow this pattern. It’s a way of saying something like “this table view wants this data”.

    Consider something like a text field object. You may have an interface with many text field objects that all report to the same delegate to define their behaviour for certain actions. By passing itself as an argument in a method to the delegate, the delegate knows which text field is calling the method.

    I’m not sure I fully understand what you’re asking, but this is the way objects inform their delegates/datasources which exact object is sending the method.
    In the case of UITableView it is less obvious because often there is only one table view per table view controller, but the text field example I gave should outline this fact.

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

Sidebar

Related Questions

I would like to pose this question as long as I am trying currently
I don't know if you would call it the canonical formulation, but to bind
This may sound a newbie question anyway I'm new to Android development. Basically what
Can't seem to find documentation on a particular formation of SQL using the LIKE
I have opended a question about repeated parameter-checks in public methods. The result there
I asked this question before but with less information than I have now. What
This is a follow up question to this one . I think I misunderstood
Background There are many tools to analyze logfiles from servers like Apache HTTP server,
I've got a problem in the formulation of my query; this is the scenario:
I had some problem formulating the question in the title, but i hope you

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.