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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:46:28+00:00 2026-05-26T10:46:28+00:00

I have a class with a large number of init… methods (UITableViewCell). My extension

  • 0

I have a class with a large number of init... methods (UITableViewCell). My extension has an extra property which when set, will adjust various cell properties such as colours. I had two options for handling the change to the property.

  1. Override the property setter, store the passed value and then set the colours etc.
  2. Override all the inits and add a KVO watch on the property that calls a private method to setup the colours etc.

Item #1 seems to be the simplest to apply, but means I have to deal with manually putting in the setter code (retains involved) as per Apples guidelines.

Item #2 sounds nice initially because I don’t have to add the setter boiler place, but would cost more code because I would have to override all the inits.

Is there any other alternatives?

  • 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-05-26T10:46:29+00:00Added an answer on May 26, 2026 at 10:46 am

    You only have to override the designated initializer(s). Typically, most classes only have one designated initializer, and classes which conform to <NSCoding> have two (the second being -initWithCoder:).

    Don’t forget, if you set up KVO in init, you’ll have to remember to unregister it in -dealloc. Objects don’t automatically unregister KVO when they go away, and if you forget then whatever object that gets allocated at the same address in the future will inherit the leaked KVO observers.

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

Sidebar

Related Questions

I have a ViewModel class which has large number of properties(Say 50). Once the
I have a class which has a large number of static fields of a
I have a large class, which I have divided into several different class extension
I have this class in Java in which I declared a large number of
I have repository to manage operations on ComplaintTypes which has a large number of
If you have a large class that executes after output(headers/text) is already sent, will
We have a large number of projects within a solution mostly simple class libraries
The class library I'm refactoring has a large number of events (over 50) each
I have to work with a large number of compiled Java classes which didn't
I have a class with a few rather large methods. In it's basic and

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.