Re: Difference in View Identifiers between Mac and iOS?


Dave
 

Hi,

On iOS:

UIView myView;

myID = myView.accessibilityIdentifier;

In code gets the identifier specified in the “Identifier” Field in the Accessibility Panel of the Storyboard/NIB.


On Mac:

NSView myView;

myID = myView.accessibilityIdentifier;

Returns nil even if the “ Identifier” Field in the Accessibility Identity Panel is set. In this case, doing:

myWorkID = myView.identifier;

Returns _NS:44 (or whatever), but if I change the Storyboard/NIB to set the “identifier” field in the “Identity" Panel, then this works as per the “accessibilityIdentifier” on iOS.

My main question is why all the different identifiers? I can make it work now, but why can’t I set/use “accessibilityIdentifier” on the Mac?

All the Best
Dave

Join cocoa@apple-dev.groups.io to automatically receive all group messages.