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

  • Home
  • SEARCH
  • 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 8042347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:32:49+00:00 2026-06-05T04:32:49+00:00

I have a view with a table View. I has subclassed TableViewCells to make

  • 0

I have a view with a table View. I has subclassed TableViewCells to make a representation of an object of my model. This Custom UITableViewCell has two buttons to change my object of the model(it makes +1 -1 to an instance variable).

So I think of how I should architecture all that, my options are:

-I put a pointer in the custom tableViewCell, when I receive a notification from one of the buttons I chance the cell and the object of the model(I don’t like this solution because a View is changing my model, bad to reuse the cell so bad)

-Create a UICustomTableViewCellDelegate protocol and an instance of id<UICustomTableViewCellDelegate> in the cell class. When I receive a message from the UIElement I call my delegate. The delegate will point to the UIViewController of the general view who has an array with all the instances of my objects and here change the model. Before change the cell view to. I think is not bad for reuse but how I will identify and recover easily my object from the array of ViewController? I think the method should be:

-(void)customTableCellViewButtonPlusPressed:(CustomTableViewCell*) cell;

-Make a viewController for the CustomTableViewCell with a reference to my object. He will receive the message from the UIButtons of the cell and change the cellView and the object of the model referenced

What is the best practice?

  • 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-05T04:32:51+00:00Added an answer on June 5, 2026 at 4:32 am

    Third solutions is the most mvc of them

    1. You will have a model, make it as heavy as possible with all the
      function and calculations to be done on the model itself
    2. The controller that is the UICustomTableViewCell, this class will read the model and realize it on the view, it will also get the events from the view and change the model accordingly
    3. and the view would be the UICustomTableViewCell xib file, that will contain the information of the cell drawing and realization

    the model will be included inside UICustomTableViewCell in a “has a” relationship
    The UICustomViewCell class will be able to send drawing functions to the view and to receive events from the view and change the model accordingly

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

Sidebar

Related Questions

I have a UITableView with custom UITableViewCells. The table has two sections, the first
In my app I have a table view with customViewCells. I subclassed the UITableViewCell
I have a Table View Controller which I have designed using storyboards. This has
I have a navigation controller which also has a table view. I want to
I have an iPhone app which has a Table View-based data input screen with
I have a view table which is a union of two separate tables (say
I have a table view controller with custom cells. In those cells i added
I'm using a table view that uses a custom UITableViewCell subclass, NoteCell . The
I have a table view which shows a table view and has a detail
I have a UITableView and a UITableCell subclass. Each table cell has two scrollviews

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.