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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:24:02+00:00 2026-06-10T04:24:02+00:00

I have created a custom UITableViewCell that is added as a subview to my

  • 0

I have created a custom UITableViewCell that is added as a subview to my view. In this view there is also a a UITableView. The custom UITableViewCell is not part(included) into the UITableView.

I have set the custom UITableViewCell up in my viewDidLoad method like this.

- (void)viewDidLoad
{
    [super viewDidLoad];

    // Create custom tableviewCell at top of screen under navigation controller

    cellContainer = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 44.0)];
    cellContainer.backgroundColor = [UIColor whiteColor];

    UITableViewCell *mycell = [[UITableViewCell alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 50.0)];
    mycell.textLabel.text = @"Select all";
    mycell.backgroundColor = [UIColor whiteColor];


    [cellContainer addSubview:mycell];
    [self.view insertSubview:cellContainer atIndex:1];

    // Set table positioning
    [subModelTableView setFrame:CGRectMake(0, 44, self.view.frame.size.width, self.view.frame.size.height - 44)];
    [self.view insertSubview:subModelTableView atIndex:0];

    // set tableview datasource and delegate
    [subModelTableView setDelegate:self];
    [subModelTableView setDataSource:self];
}

The thing being at the moment I am unable to select this custom tableview cell, I have tried to set a selector on it like this

[mycell addTarget:self action:@selector(myAwesomeMethod:) forControlEvents:UIControlEventTouchUpInside];

but I am getting an error

No visible @interface for 'UITableViewCell' declares the selector 'addTarget:action:forControlEvents:'

So I would like to know if there is either another way of doing this (proper way) or if I am on the right track how can I resolve this error?

EDIT:
The reason I have this extra UITableViewCell in this view is that it sits below the UINavigationBar as a static cell with @”Select all” in it, this cell sits above the UITableView but gives the appeance of being included in the UITableView but obviously is not.

When the user scrolls the UITableView of values if the user dose not know which cell he would like to select I want to enable the @”Select all” cell, so he receives a list of values that would represent selecting every cell in the UITableView. I hope this makes sense.

  • 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-10T04:24:03+00:00Added an answer on June 10, 2026 at 4:24 am

    So I would like to know if there is either another way of doing this
    (proper way) or if I am on the right track how can I resolve this
    error?

    I don’t think this is the correct way to do it. I think you should use the UITableViewDelegate’s didSelectRowAtIndexPath method. If this isn’t going to work, then please elaborate on what you’re trying to do so a better suggestion can be provided.

    http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableViewDelegate_Protocol/Reference/Reference.html

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

Sidebar

Related Questions

I have created a custom view that contains a UIPickerView and a UITableViewCell to
I have created a custom subclass of UITableViewCell. There, I allow the user to
I have created a UITableView with a custom UITableViewCell . My cell includes one
I have a custom UITableViewCell created in IB. All my cells will have this
I have a simple problem. I created a custom UITableViewCell that includes a UISwitch
I have a custom UITableViewCell created through code (not Interface Builder). I have sub-views
I have a custom UITableViewCell that I use like this: AppTableCell *cell = [tableView
I've a custom table view cell that I created using XIB: I've also linked
I am facing this very weird problem, I have created a custom UITableViewCell on
I have an UITableView showing custom view cells that I've designed in interface builder.

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.