Re: Silly question on extending NSObject.
Re: Silly question on extending NSObject.
- Subject: Re: Silly question on extending NSObject.
- From: Rob Petrovec <email@hidden>
- Date: Tue, 19 Feb 2019 19:31:28 -0700
> On Feb 19, 2019, at 7:23 PM, Alex Zavatone <email@hidden> wrote:
>
>
>> On Feb 19, 2019, at 4:15 PM, Jens Alfke <email@hidden> wrote:
>>
>>
>>
>>> On Feb 19, 2019, at 1:23 PM, Alex Zavatone <email@hidden
>>> <mailto: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?
>
> This.
>
> (lldb) po self.data
> <DataStorage: 0x61000005af40>
>
> (lldb) po [self.data description]
> <DataStorage: 0x61000005af40>
>
> (lldb) po [self.data autoDescribe]
If you override -debugDescription in your custom classes to spew
whatever you want them to spew, you can just do ‘po self.data’ in the debugger
and it will spew out your custom data.
—Rob
_______________________________________________
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