Monday, April 24, 2017

#1 2016-10-17 05:50:35 pm

StevenH
Member
Registered: 2016-09-17
Posts: 29

Identifying deprecated methods

Hi there,

While XCODE can warn you for object c files if the contain a deprecated method (based on sdk) I was wondering if there's something similar (toggleable) for Asoc?

Offline

 

#2 2016-10-17 07:50:50 pm

Shane Stanley
Member
From: Australia
Registered: 2002-12-07
Posts: 4996

Re: Identifying deprecated methods

No, there isn't. And unfortunately in several cases the ASObjC choice is between deprecated methods and no methods at all.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#3 2016-10-18 05:47:20 am

StevenH
Member
Registered: 2016-09-17
Posts: 29

Re: Identifying deprecated methods

Thank you.

Any recommendations for best practice of identifying deprecated methods for ASOBJC?

Offline

 

#4 2016-10-18 06:35:02 am

Shane Stanley
Member
From: Australia
Registered: 2002-12-07
Posts: 4996

Re: Identifying deprecated methods

It's really a question of looking in either the documentation or the .h files. The complication is, as I said, sometimes you need to use deprecated methods. For example, the NSAlert method for showing an alert as a sheet, -beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:, is deprecated in favor of -beginSheetModalForWindow:completionHandler:. But you can't call the latter from ASObjC, so you need to use the deprecated methods.

There can be subtle distinctions on what deprecated means. Mostly, for ASObjC purposes it means use something else if you can.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#5 2016-10-19 04:58:13 am

StevenH
Member
Registered: 2016-09-17
Posts: 29

Re: Identifying deprecated methods

Thank you.
This is always a great help!

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.079 seconds, 10 queries executed ]

RSS (new topics) RSS (active topics)