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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:09:48+00:00 2026-05-26T07:09:48+00:00

Do I have to DECLARE all private methods in .m class file inside @interface

  • 0

Do I have to DECLARE all private methods in .m class file inside

@interface ClassName()
  //Privare Methods
@end

before

@implementation ClassName
  // Implementation of Private & Instance methods
@end

for every method I am implementing & using OTHER THEN the instance methods (methods declared in .h file)?

X-Code 4 DOES NOT give me WARNING for ALL private methods but ONLY for few of them. For example, it warns me for methods I am calling inside gesture handler functions but not inside other routines/methods. I am confused as to declare all non-instance methods or just declare the ones I get warned for.

  • 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-26T07:09:49+00:00Added an answer on May 26, 2026 at 7:09 am

    XCode won’t warn about methods that appear before the point of invocation:

    @implementation 
    
    - (void) foo:(float)x;
    {
        NSLog(@"%f", x); // prints 15.000000
    }
    
    - (void) bar;
    {
        [self foo:15.0]; // no warning
        [self baz:15.0]; // warning
    }
    
    - (void) baz:(float)x;
    {
        NSLog(@"%f", x); // prints 0.000000 instead of 15.0
    }
    
    @end
    

    It is strongly recommended to declare methods which you are warned about, the code above gives one example why.

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

Sidebar

Related Questions

I have a header file variable.h where i declare all my global variable.Then i
I have a program of some length, with a class and many methods. All
I've read that you cannot declare static variables/methods inside a generic class and I
I have a question What happend when I declare a variable inside a method,
I have some ASP.NET web services which all share a common helper class they
I have a base class that declares a private non-static reference to the DataBase
In my application, I have a file: private File TEMP_PHOTO_FILE = new File(Environment.getExternalStorageDirectory(), temp_photo.jpg);
In C#, if I declare an auto-implemented property, why do I have to declare
I have this code: dojo.declare(City, null, { constructor : function(cityid, cityinfo){ } }); dojo.declare(TPolyline,
I have a stored procedure DECLARE cursor FOR SELECT [FooData] From [FooTable]; OPEN cursor

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.