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

给断点添加条件

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

 

整数情况:

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

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

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

 

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

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

 

posted on 2016-05-03 18:34  传说中的汽水枪  阅读(1064)  评论(0编辑  收藏  举报

导航