Re: Silly question on extending NSObject.
Re: Silly question on extending NSObject.
- Subject: Re: Silly question on extending NSObject.
- From: Jens Alfke <email@hidden>
- Date: Tue, 19 Feb 2019 14:15:56 -0800
> On Feb 19, 2019, at 1:23 PM, 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.
I’m not sure what this does that the existing -description and
-debugDescription methods don’t do?
> Is there a more modern way to do this than using a .pch?
You don’t need a PCH for this. If you declare the category in an @interface or
@implementation that gets parsed as part of your target, it’ll exist. Same for
the methods in the category. It doesn’t matter whether the interface is parsed
in every source file or not.
—Jens
_______________________________________________
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