iOS NSLog error with Unicode characters

前端 未结 2 1989
滥情空心
滥情空心 2021-01-13 02:09

Can anyone tell me the cause of the discrepancy for the following results ?

completionHandler:^(NSArray *placemarks, NSError *error) {
    NSLog(@\"\\n place         


        
2条回答
  •  难免孤独
    2021-01-13 02:42

    Interesting :)

    Passing %@ into NSLog's format string just means 'call description on an object'.

    It looks like description on NSArray deals with unicode characters differently than the description on each object.

    However, I suspect that the description method on NSArray just calls description on each of the objects it contains and then, for some reason I'm not 100% sure about, is encoding them before dumping them out to NSLog.

提交回复
热议问题