zoukankan      html  css  js  c++  java
  • Xcode调试打印方法

    1 NSLog

    在调试的过程中,最常用的查看变量值的方法是NSLog

    整数 int a = 1; NSLog("%d", a);

    浮点数 float b = 1.11; NSLog("%f", b);

    字符串 NSString *str = @"abc"; NSLog("%@", str);

    数组 NSArray *arr = [NSArray arrayWithObjects:@"abc", @"def", @"ghi", nil]; NSLog("%@", array);

    字典 NSDictionary *dict = [NSDictionary dictionaryWithObject:@"abc" forKey:@"123"]; NSLog("%@", dict);


    2 print

    在调试的过程中,可以在底部All Output窗口中使用print来打印整型、浮点型、布尔型的值,比如print bgImage.size.height


    3 po 

    在调试的过程中,可以在底部All Output窗口中使用po来打印对象的值,比如po self.view

     

     

  • 相关阅读:
    HttpClient
    Android子线程访问网络
    PhoneURLConnectGEt
    PhoneHttpGet
    PhoneNote
    SQLite
    书单
    通过Web预测网页出版日期的学习
    LeetCode-Maximum Subarray[dp]
    LeetCode-Triangle[dp]
  • 原文地址:https://www.cnblogs.com/sunminmin/p/4516520.html
Copyright © 2011-2022 走看看