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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:38:13+00:00 2026-06-13T13:38:13+00:00

So I’ve recently been using more private interfaces in my classes. I’ve been leaving

  • 0

So I’ve recently been using more private interfaces in my classes. I’ve been leaving the stuff that is needed by other classes in the .h (public), and then keeping all other methods in the private interface in the .m. My question is, I don’t see any reason to keep any methods in my private interface as the app works fine without this. What is really the point? Any why aren’t system methods like viewDidLoad in the private interface?

  • 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-13T13:38:15+00:00Added an answer on June 13, 2026 at 1:38 pm

    So I’ve recently been using more private interfaces in my classes. I’ve been leaving the stuff that is needed by other classes in the .h (public), and then keeping all other methods in the private interface in the .m.

    That’s perfect. In some cases, you will want to use naming conventions or prefixes to avoid naming collisions. Moving on…

    My question is, I don’t see any reason to keep any methods in my private interface as the app works fine without this. What is really the point?

    Encapsulation. Hide your data and implementation from your clients (and even subclasses) in order to minimize the side effects of any changes you must make. If the client really only needs 3 methods in the public interface — declare only those 3 methods. Keep the remainder of the implementation details private to the class. When you don’t use this, mutant implementations tend to multiply where clients use these unnecessary methods. Which means that when you need to change something, you will have a ton of detail to review across several source files (and apps, if you write libraries). A class’ public interface is a good area to focus on being minimal.

    Any why aren’t system methods like viewDidLoad in the private interface?

    viewDidLoad was designed to be overridden by subclasses, where necessary. Its declaration is public for 2 primary reasons:

    • Documentation. Your implementations will need this initialization step, and you need to know how to override it correctly.
    • So you can write [super viewDidLoad], and the compiler can be assured you are doing the right thing. If UIViewController had not declared it as an instance method, there would be at least one compiler warning.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... 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.