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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:09:45+00:00 2026-05-22T17:09:45+00:00

Possible Duplicate: @class vs. #import In Objective-C, what are the best practices for using

  • 0

Possible Duplicate:
@class vs. #import

In Objective-C, what are the best practices for using forward declarations (of classes or protocols) vs. #import-ing files? And why are forward declarations recommended at all if #import ensures no file is included more than once? I’m thinking of iOS app development in particular, but I assume this applies to Objective-C in general.

  • 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-22T17:09:46+00:00Added an answer on May 22, 2026 at 5:09 pm

    My rule of thumb is: If a forward declaration is sufficient, I use it. Otherwise I import the full declaration with #import.

    This is mainly from my experience with large projects where the careless use of #import (or #include) can easily lead to situation where the compiler has to compile more than a million lines of code for each non-header file and where minor changes in a single header file trigger tons of recompilation. As a consequence, compile the code takes a long time.

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

Sidebar

Related Questions

Possible Duplicate: from . import x using __import__ ? How does one do the
Possible Duplicate: Class names that start with C. I am a newbie using c++
Possible Duplicate: Why shall I use the “using” keyword to access my base class
Possible Duplicate: Retain precision with Doubles in java import static java.lang.System.out; public class q2{
Possible Duplicate: Why is using a wild card with a Java import statement bad?
Possible Duplicate: Namespace only class visibility in C#/.NET ? What I want is to
Possible Duplicate: Why XML-Serializable class need a parameterless constructor Does anyone know if it
Possible Duplicate: StructureMap singleton usage (A class implementing two interface) I'm currently designing a
Possible Duplicate: Most efficient implementation of a large number class Suppose I needed to
Possible Duplicate: How do you find all subclasses of a given class in Java?

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.