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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:41:14+00:00 2026-06-09T17:41:14+00:00

I know that @class is suppose to speed up compile time, but if I

  • 0

I know that @class is suppose to speed up compile time, but if I had a case like this:

#import <Foundation/Foundation.h>
@class BNRItem;
@interface BNRItemStore : NSObject
@end

#import "BNRItemStore.h"
#import "BNRItem.h"

@implementation BNRItemStore
@end

Could I do this instead and still get the same compile time:

#import <Foundation/Foundation.h>
#import "BNRItem.h"
@interface BNRItemStore : NSObject
@end

#import "BNRItemStore.h"

@implementation BNRItemStore
@end
  • 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-09T17:41:15+00:00Added an answer on June 9, 2026 at 5:41 pm

    (assuming you actually use BNRItem someplace in these files)

    it would be the same for BNRItemStore.m, but it is likely to increase compile times and recompilation frequency for anything that #imports BNRItemStore.h — because it’s common that many classes that need to see BNRItemStore do not need to also see BNRItem‘s @interface.

    as that pattern spreads to many headers in your projects, a simple edit to one header can require recompiling a large set of files, with a large set of included files. it also spreads to the indexer, which is continually indexing based on changes.

    best to use the forward declarations, unless your project is (and will remain) tiny.

    it’s actually really nice to be able to declare all your instance variables/properties in the .m — as this is a fairly new addition to clang. abstraction and build times can improve significantly.

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

Sidebar

Related Questions

I know that if I do something like this: class Obj { public: int*
I know that if I have an XML file like this: <persons> <class name=English>
i know that .NET String class uses such behaviour, but I can't find any
I know that I can do something like: public class AbstractDao<T extends Bean> {
Suppose we have an arbitrary graph represented by nodes and pointers like this: class
Suppose I have some code like this: class Visitor { public: Visitor(callBackFunction) {} void
Suppose I initialize members of a class like this: class A { public int
I am writing a class that I know that needs a lock, because the
We know that in a class, functions starting with __function__ do not get imported
I know that the Properties class is a sub-class of Hashtable. So all the

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.