It's so strange.
Here is my oc file:
- (void)viewDidLoad {
[super viewDidLoad];
static NSInteger a = 1;
NSMutableArray * arr = [NSMutableArray new];
NSString * s1 = @"1";
NSString * s2 = [NSString stringWithFormat:@"1"];
void (^Block)(NSInteger num) = ^(NSInteger num) {
NSLog(@"%d",a);
[arr addObject:@"1"];
};
a = 2;
Block(a);
NSLog(@"%@",arr);
// Do any additional setup after loading the view.
}
launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "sweetpad-lldb",
"request": "attach",
"name": "SweetPad: Build and Run (Wait for debugger)",
"preLaunchTask": "sweetpad: debugging-launch"
}
]
}
SweetPad: 0.1.73
Xcode: 16.0