MyClass.h:
@interface MyClass : NSObject
@end
MyClass.m:
// Define a private variable in a class extension
@interface MyClass () {
NSString *name;
}
@end
Then later on in lldb:
(lldb) po myClassInstance->name
error: 'MyClass' does not have a member named 'name'
error: 1 errors parsing expression
So how do you access that variable in the debugger?
Using xcode 4.3.2
Thanks!
To access class variables, you use the same dot notation as with instance variables. To retrieve or change the value of the class variable, you can use either the instance or the name of the class on the left side of the dot.
Swift 3 added the fileprivate keyword. An entity that is declared fileprivate is only accessible from within the file it is defined in.
X++ Copy. [ExtensionOf(classStr(BusinessLogic1))] final class BusinessLogic1_Extension { str doSomething(int arg) { // Part 1 var s = next doSomething(arg + 4); // Part 2 return s; } } In this example, the wrapper around doSomething and the required use of the next keyword create a Chain of Command (CoC) for the method ...
(lldb) po [myClassInstance valueForKey:@"name"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With