开发者

Can anyone give example of forward declaration in objective C for a normal class and not for category or protocol?

开发者 https://www.devze.com 2023-02-08 02:02 出处:网络
Can anyone give example of forward declaration in objective C for a normal class and not for category or pr开发者_StackOverflowotocol?/*

Can anyone give example of forward declaration in objective C for a normal class and not for category or pr开发者_StackOverflowotocol?


/*
  using a forward declaration of NSDocument, there's no need
  for every source that encounters this header to include AppKit,
  allowing much faster compile times and reducing dependency
  changes for clients.

  of course, MONThang.m will need to include AppKit to use NSDocument
  - but the clients using MONThang do not need to import AppKit.
*/

@class NSDocument; // << the forward declaration

@interface MONThang : NSObject
{
    NSDocument * document;
}

@end
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号