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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:47:08+00:00 2026-06-16T11:47:08+00:00

What is the proper place to put #define statements in Objective-C? They technically work

  • 0

What is the proper place to put #define statements in Objective-C?

They technically work in a number of locations, but what is the “right” place to put them?

Between the #include statements and the @interface statement in my .h file??

#import <UIKit/UIKit.h>

#define BAR        1
#define FOO        2

@interface MyViewController : UIViewController

Or perhaps inside the @interface statement?

#import <UIKit/UIKit.h>

@interface MyViewController : UIViewController

#define BAR        1
#define FOO        2

Is there a best practice I should be following?

  • 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-16T11:47:10+00:00Added an answer on June 16, 2026 at 11:47 am

    When used in a .h file like this, I treat them like they are global variables. Therefore I put them after the import statements and before the interface. In other words, like your first option.

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

Sidebar

Related Questions

Where is the proper 'place' in JSF to put initialisation snippet that follows, in
This yields proper results, but I would like to have the resulting row in
I'm trying to lock down my understanding of proper memory management within Objective-C. I've
http://buttonspace.com/ I want to put equal space between the 4 buttons at the top,
i found a worked example at this site http://jsfiddle.net/VNXb2/26/ , but when i put
I am trying to parse an XML File, but there is one place where
If making things work is only requirement, we can put all controlling login and
What is the proper place to explain error handling in a try-catch statement? It
I followed the github meteorirc project's lead and put them in /public/ I installed
EDIT : proper solution: void add(Student s) { if(root == null) root = new

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.