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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T21:52:57+00:00 2026-05-19T21:52:57+00:00

I have a retain property, which is an NSArray of child View controllers. I

  • 0

I have a retain property, which is an NSArray of child View controllers. I want to modify the setter of this property so that when the view controllers are set I set a property on the view controller containing a reference to self.
In the same way when you add a view controller to a tab bar controller, the view controllers tabBarController property is set.

Should I be creating a custom setter (rather than the synthesized one) or should /i be using key value observing I think I’ve heard about.

  • 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-19T21:52:57+00:00Added an answer on May 19, 2026 at 9:52 pm

    Although you could do it either way, my personal opinion would be to use a custom setter – if only because it would make it clearer for a third-party exactly what was doing what in the code. Using your own setter is probably more readable than setting up a key-value observer and having a method triggered upon a property change.

    Also, from a computational perspective using KVO is more expensive than a custom setter. The impact in your application may be negligible, but it’s worth considering.

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

Sidebar

Related Questions

I have an UIButton array like this: @property (nonatomic, retain) IBOutletCollection(UIButton) NSArray *btn_Impact_Collection; and
I have a variable declared like this: @property (nonatomic, retain) NSMutableArray *aInfo; At the
Do I have this right ... // Reactor.h @property(nonatomic, retain) NSMutableArray *reactorCore; // Reactor.m
I have one array. I want that array to retain its value between function
I have a view MyView , and it has images which I want to
I have an object Foo that has an NSNumber property which is declared like
When you have a property which you retain in the interface and you alloc
I know that if I retain an IBOutlet by using property then I have
I have a property in my class, which is an NSArray. I am retaining
I have a simple protocol with a property: @protocol StopsSource <NSObject> @property (retain,readonly) NSArray

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.