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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:32:51+00:00 2026-06-12T21:32:51+00:00

I have a UITableView class that i am calling in another class MyPocketTableView *

  • 0

I have a UITableView class that i am calling in another class

 MyPocketTableView * myPocketTableView = [[MyPocketTableView alloc]initWithFrame:CGRectMake(85, 153, 235, 250) style:UITableViewStyleGrouped]; 

However, the init method in the UITableViewClass does not let me do this.

@implementation MyPocketTableView

- (id) initWithFrame:(CGRect)frame style:(UITableViewStyle)style {
    self = [super initWithFrame:frame];
    self = [super initWithStyle:style]

    if (self) {

        //[self setFrame:CGRectMake(85, 153, 235, 250)];
        self.dataSource = self;
        self.delegate = self;

    }
    return self;
}

I cannot add style : (UITableViewStyle) style on to the init method definition, nor can i do the self = [super initWithStyle:style] because it complains saying

No visible @interface for ‘UITableView’ declares the selector initWithStyle.

The default init method that was there when the class was created was - (id) initWithFrame:(CGRect)frame. MyPocketTableView is a sub class of UITableView.

  @interface MyPocketTableView : UITableView <UITableViewDataSource,UITableViewDelegate>
  • 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-12T21:32:52+00:00Added an answer on June 12, 2026 at 9:32 pm

    You need to set the interface to UITableViewController, then use initWithStyle:.

    Also, in doing the following, there is no need to set the UITableView protocol delegates

    @interface MyPocketTableView : UITableViewController
    

    Then you can call:

    MyPocketTableView * myPocketTableView = [[MyPocketTableView alloc] initWithStyle:UITableViewStyleGrouped];
    

    As well as the following:

    - (id) initWithStyle:(UITableViewStyle)style 
    {
        self = [super initWithStyle:style];
        if (self) {
            [self setFrame:CGRectMake(85, 153, 235, 250)];
        }
        return self;
    }
    

    You can also use the following (example) custom method: The key being you are calling:

    self = [super initWithStyle:UITableViewStyleGrouped];

    - (id) initWithSomeCustomMessage:(NSString*)message
    {
        self = [super initWithStyle:UITableViewStyleGrouped];
        if (self) {
            [self setFrame:CGRectMake(85, 153, 235, 250)];
            self.customMessage = message;
        }
        return self;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my iPhone app I have a UIViewController that has a UITableView and another
I have a TabBar App. I have created a UITableView class called Schedule that
I have a parent class that handles all the UITableview persistent data management and
I have an instance of a UITableView, and a separate class that adheres to
I have a UITableView class that uses the following methods to call a loading
I have a UITableView in a ViewController class. The ViewController class uses a custom
I have a UIView with UITableView component and I want to create a class
Here is the situation, I have UIViewController class with a UITableView outlet. I would
I have UITableView.when i click on it's 1 st row one another UITableView opens
I have a UITableView that lists comments from various users. I save all of

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.