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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:59:16+00:00 2026-06-16T21:59:16+00:00

Okay so i decided to move my code for my UITableView delegates into another

  • 0

Okay so i decided to move my code for my UITableView delegates into another class. a subclass if you will, A subclass so that it would make it easier to access all the elements my Cellforrowwithindexpath function does within said subclass.

But now there is a slight issue…

It works fine, as far as the UItableView is concerned, But then when i tried to use the navigation controller to push a view on top, it did not work, i then discovered that self…Within my main class was actually an instance of my subclass…What? so self is not actually equal to self…

Can anyone give me any insight as to what i am doing so colossally wrong here?

EDIT: So i changed it to instead be a subclass to a delegate and it works fine, just in case anyone else runs into This issue, But i am still confused as to why it was happening in the first place…

Code:

@interface OpenGameList : MainMenuViewContoller <UITableViewDelegate,UITableViewDataSource>
{

}

@end

In my MainMenuViewController’s viewDidLoad function

_openGameList = [[OpenGameList alloc] init];
_openGameList.delegate = self;

friendsTable.delegate = _openGameList;
friendsTable.dataSource = _openGameList;

And than after that it seems that any use of self in MainMenuViewController is equal to OpenGameList hence why using [[fromView navigationController] pushViewController:toView animated:NO]; does not work

  • 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-16T21:59:17+00:00Added an answer on June 16, 2026 at 9:59 pm

    self always points to the object that was actually instantiated – the most derived class.

    When you have an instance of a subclass, and you send a message to self, the subclass’s implementation will always be invoked if there is one. It doesn’t matter whether or not you’re in the superclass’s implementation file or the subclass’s implementation file.

    This is an essential for polymorphism: it’s what allows subclasses to override the behavior of a parent class. Take -[UIView drawRect:] for example. To invoke the drawing code for subclasses, when code in UIView invokes [self drawRect:] it’s the subclass’s drawing implementation which needs to be called.

    It might help to remember that superclasses and subclasses aren’t parent and child objects, but less and more specific types which apply to the same object. A UITableView is also a UIScrollView, UIView, and NSObject, but when you make one, there is one object which is all of those things, and self always refers to that one.

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

Sidebar

Related Questions

Okay, I'm totally new to Python, so I decided to make a simple app.
Okay, next PHPExcel question. I have an HTML form that users fill out and
Okay - I have a dilemma. So far my script converts page titles into
okay, i'm setting up a multi-user chat system. i have a messages table, that
Okay, I've got the FormType described below. I use this Form class for both
Okay, so the issue I'm being stuck at for few days already is that
Okay, so I'm using perl to read in a file that contains some general
You read the title and groaned. That's okay. I did too. But we do
Okay, so I decided to take the Google classes for learning droid devving. I
Okay, so I am a beginner at Cocoa and I've decided to try to

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.