Why doesn't the console in Xcode print an object property using dot notation?

I have a UIButton on which I set accessibilityLabel. Why can't the console find the availability label property when trying to print it using dot notation?

(lldb) po self.closeButton.accessibilityLabel
error: property 'accessibilityLabel' not found on object of type 'UIButton *'
error: 1 errors parsing expression
(lldb) po [self.closeButton accessibilityLabel]
topsecretlabel
+4
source share
2 answers

accessibilityLabelnot a property UIButton. This is the method defined by the unofficial protocol UIAccessibilityto which it responds UIButton. lldbtends to be stricter with respect to these things than clang, and it is not strictly legal to invoke property through point notation.

, lldb. , UIButton ( NSObject). .

+5

, ObjC, - , . , , lldb , . , . . , , , ( .)

, , accessibilityLabel, . , clang , , . , accessibilityLabel UIAccessibility NSObject. , . , .

+1

Source: https://habr.com/ru/post/1538906/


All Articles