Say my range is created as
假设我的范围被创建为
NSRange myRange = {0,100};
How do I print myRange
in NSLog? The following is not working
如何在NSLog中打印myRange ?以下内容无效
NSLog(@"my range is %@",myRange);
2 个解决方案
#1
47
Use NSStringFromRange
.
使用NSStringFromRange。
NSLog(@"my range is %@", NSStringFromRange(myRange));
In Swift you can do:
你可以迅速地做到:
print("my range is \(NSStringFromRange(myRange))")
#1
47
Use NSStringFromRange
.
使用NSStringFromRange。
NSLog(@"my range is %@", NSStringFromRange(myRange));
In Swift you can do:
你可以迅速地做到:
print("my range is \(NSStringFromRange(myRange))")