首页 xCode-控制台命令
文章
取消

xCode-控制台命令

1
Person *obj = [[Person alloc] init];

po指令

1
2
po obj
<Person: 0x6000030f1260>

p指令

  • p默认打印十进制
1
2
p obj
(Person *) $0 = 0x00006000030f1260
  • p/x打印十六进制
    1
    2
    
    p/x obj
    (Person *) $1 = 0x00006000030f1260
    
  • p/o打印八进制
    1
    2
    
    p/o obj
    (Person *) $2 = 03000000303611140
    
  • p/t打印二进制
    1
    2
    
    p/t obj
    (Person *) $3 = 0b0000000000000000011000000000000000000011000011110001001001100000
    
  • p/f浮点打印
    1
    2
    
    p/f obj
    (Person *) $3 = 0b0000000000000000011000000000000000000011000011110001001001100000
    

x:输出对象的内存地址,后面可接参数,”x/2gx”:2为个数,g为8字节大小,x为16进制形式

1
2
x/2gx obj
0x6000030f1260: 0x0000000104b0e600 0x0000000000000000
1
2
3
x/4gx obj
0x6000030f1260: 0x0000000104b0e600 0x0000000000000000
0x6000030f1270: 0x0000000000000000 0x0000000000000000
本文由作者按照 CC BY 4.0 进行授权

Swift语法学习

设计模式学习

Comments powered by Disqus.