• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Silly question on extending NSObject.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Silly question on extending NSObject.


  • Subject: Re: Silly question on extending NSObject.
  • From: Wim Lewis <email@hidden>
  • Date: Tue, 19 Feb 2019 14:21:42 -0800

On 19. feb. 2019, at 1:23 e.h., Alex Zavatone <email@hidden> wrote:
> In most Objective-C projects I add an autodescribe category on NSObject and
> put the import for the category header into a .pch for the project so that it
> will be available for every class in the project.
>
> This lets me dump an object’s properties and values at Will in the debugger.
>
> Is there a more modern way to do this than using a .pch?


Xcode's toolchain supports "prefix headers", which are essentially just
additional import statements prepended to every file in the target. This gets
the behavior you want, I think, without relying specifically on .pch files,
which are an implementation detail of a particular compiler optimization.

In Xcode you can find this under "Language ▷ Prefix Header" or the
"GCC_PREFIX_HEADER" build setting.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Silly question on extending NSObject. (From: Alex Zavatone <email@hidden>)
 >Re: Silly question on extending NSObject. (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: Silly question on extending NSObject.
  • Next by Date: Re: Silly question on extending NSObject.
  • Previous by thread: Re: Silly question on extending NSObject.
  • Next by thread: My eyes are failing me.
  • Index(es):
    • Date
    • Thread