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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:53:25+00:00 2026-06-02T10:53:25+00:00

So far I´ve only needed to implement prototype cells with pre-defined designs (normal, subtitle,

  • 0

So far I´ve only needed to implement prototype cells with pre-defined designs (normal, subtitle, etc.) and it hasn´t been a problem.

Now I need to implement prototype cells which contain some controls like a segmented switch, a switch or any other. The problem is that I haven´t been able to find out how the actions triggered are implemented and how are they related to the control. Also I heven´t found any example of how different prototype cells inside a single UITableViewController are implemented.

I know it´s kind of a generic question, but I´d appreciate some pointers here. Maybe someone knows about some documentation, tutorial, etc. Well, any help would do,

Thnaks in advance.

  • 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-02T10:53:26+00:00Added an answer on June 2, 2026 at 10:53 am

    It took me also a while to understand how to use the prototype cells. If you want to access the user interface elements inside a prototype cell, you have to create a subclass of UITableViewCell and assign it to the prototype cell in Interface Builder.
    Then you have to define the IBOutlet properties manually e.g.:

    @interface OptionSwitchCell : UITableViewCell
    @property (weak, nonatomic) IBOutlet UISwitch* switchControl;
    @end
    

    After that, you can connect the interface elements through control-dragging from the element to the property definition in the assistant view.
    The IBActions instead can be defined inside the owning View Controller. You can control-drag from a interface element to the View Controller header file and create an action. Inside the action implementation you will likely want to know which cell was been triggering the action. I do it like this:

    @implementation SomeTableViewController
    
    - (IBAction)toggleActivity:(id)sender {
        OptionSwitchCell* cell = (OptionSwitchCell *)[sender superview].superview;
        NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
        ...
    }
    
    @end
    

    Another solution for finding the corresponding cell and index path (by jrturton):

    - (IBAction)toggleActivity:(id)sender {
        CGPoint hitPoint = [sender convertPoint:CGPointZero toView:self.tableView]; 
        NSIndexPath *hitIndex = [self.tableView indexPathForRowAtPoint:hitPoint];
        OptionSwitchCell* cell = (OptionSwitchCell *)[self.tableView cellForRowAtIndexPath:hitIndex];
        ...
    }
    

    Although this is a bit quirky, I haven’t found a better solution so far. Hope that helps.

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

Sidebar

Related Questions

So far the only way I have been able to keep index.yaml updated when
thus far i've only been using some basic jquery selectors and functions. but i'm
So far, I've only been passing javascript strings to my web methods, which get
I am trying to create a simple XML-Template which so far only consists of:
so far i only know to use Ctrl-Shift-A to do SVN in TextMate. is
So far I've only built small graphical applications, using swing and JComponents as I
Done quite a lot of searching around this one and so far I've only
I'm trying to write some C code which is portable only so far as
The only experience I have so far with a touchscreen interface was one where
I've only done a bit of Flex development thus far, but I've preferred the

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.