iOS bug调试技巧学习----breakpoint&condition

时间:2021-09-07 07:57:21

给断点添加条件

- (void)testCondition2
{
NSArray *array = @[@"我们", @"一起", @"来", @"玩", @"abc123"];
NSInteger i = arc4random() % array.count;
NSString *str = array[i];
NSLog(@"%zd, %@", i, str);
NSLog(@"%zd, %@", i, str);
}

整数情况:

iOS  bug调试技巧学习----breakpoint&condition

字符串情况下(有non-ASCII characters):

iOS  bug调试技巧学习----breakpoint&condition

字符串情况下(无non-ASCII characters):

iOS  bug调试技巧学习----breakpoint&condition

这个condition 后面可以有分号(';')或者没有.

特别是在: 字符串情况下(有non-ASCII characters), 可以参考:

http://*.com/questions/17192505/error-in-breakpoint-condition