`
jiangduxi
  • 浏览: 444457 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

Object C output

 
阅读更多
学习Object C编程 首先学习下Object C的output语句的实现
1. NSLog()方法
   NSLog(@"Hello, World.");

2.定义一个String类型的并且赋值
   NSString *helloWorld = @"Hello World";
   NSLog(helloWorld);

3.%a的用法
   NSString *helloWorld = @"Hello World";
   NSLog("Welcome %a",helloWorld);

输出:Welcome Hello world。
4.NSNumber()
  NSString *firstName = @"David";
  NSNumber  *age = @27;
  NSLog("%a is %a years old.",firstName, age);

输出:David is 27 years old.
5.NSArray()
    NSArray *app =@[@"A",@"B",@"C"];
   NSLog(app[1]);
    app = @[@"A',@"B",@"C",@"D"];

输出: B
6. NSDictionary() key -value 操作
     NSDictionary *rates =@{@"A":@3, @"B":@7};
     NSLog(rates[@"B"]);

输出: 7

以上是Object c学习的第一课程。

分享到:
评论

相关推荐

    Interactive.Object.Oriented.Programming.in.Java

    This book uses Java and Eclipse to write and generate output for examples in topics such as classes, interfaces, overloading, and overriding. Interactive Object Oriented Programming in Java uniquely ...

    Redirecting Standard Output to a CEdit Control

    A fancier way of using this class is to dynamically allocate an object of CRedirect and provide a Stop button that allows you to terminate the child process, as shown in the following (an abbreviated ...

    Object-Oriented Software Construction 2nd

    PART C: OBJECT-ORIENTED TECHNIQUES 163 Chapter 7: The static structure: classes 165 7.1 OBJECTS ARE NOT THE SUBJECT 165 7.2 AVOIDING THE STANDARD CONFUSION 166 7.3 THE ROLE OF CLASSES 169 7.4 A ...

    用PB如何实现串口通讯

    用C编写相应的动态连接库(DLL)函数,然后在PB中调用固然是一个好办法。可是,如果不熟悉C和WindowsAPI的调用,就显得有些困难了。...实现方法如下,先在窗 ...ole_comm1.Object.Output = "a" //向COM口发送字符

    AD原理图编译ERROR:GND contains Output Pin and Power Pin objects

    Altium designer ERROR系列:GND contains Output Pin and Power Pin objects Net GND countains multiple Output Pins ——浅论0欧电阻用处 在画一块L298N芯片驱动舵机电路时,原理图编译出现了以下两个error: (1...

    tensorflow_object_detection_api_demo:tensorflow对象检测api演示

    tensorflow_object_detection_api_demo #在根目录下创建一个output目录 mkdir /output cd /output/ #下载旧版本的tensorflow model(object api 包含在model里),最新版本的api存在问题(当前2018.4.20) wget ...

    C语言双语词汇对照表

    5. 目标程序:Object Program 6. 编译:Compile 7. 编译程序:Compiler 8. 连接程序:Linker 9. 连接:Link 10. 可执行程序:Executive Program 11. 注释:Note 12. 算法:Algorithm 13. 调试:Debug 14. 运行:Run...

    Objective-C头文件导出工具class-dump

    Objective-C头文件导出工具class-dump 。 Current version: 3.4 (64 bit Intel) Requires Mac OS X 10.7 or later. class-dump 3.4 (64 bit) Usage: class-dump [options] where options are: -a show instance...

    object-each:遍历对象条目

    每个对象 安装 npm install object-each 用法 每个(obj,fn) 例子: import each from 'object-each' ; each ( { a : 'x' , b : 'y' , c : 'z' } , ( value , ...// output: // a x // b y // c z 麻省理工学院执照

    ICC8051 Micro Series 8051 C-Compiler V4.10A/DOS

    -r{012in} Enable debugger output in object 012: Select debug model (0 default) i: Enable #include file source n: No source code option -l file Generate a list on: <file> -Lprefix Generate a list ...

    Sortable前端框架

    // `dataTransfer` object of HTML5 DragEvent }, // Element is chosen onChoose: function (/**Event*/evt) { evt.oldIndex; // element index within parent }, // Element dragging started onStart: ...

    sort-keys-recursive:递归地对arrayobject的键进行排序

    递归排序键 递归排序对象的键。...const output = sortKeysRecursive ( object ) console . log ( output ) // { // a: { // a: 0, // b: 0, // c: ['a', 'b', 'c'] // }, // b: 0, // c: 0 // }; 原料药

    jscon-c-0.10

    The JSON-C implements a reference counting object model that allows you to easily construct JSON objects in C, output them as JSON formatted strings and parse JSON formatted strings back into the C ...

    CANopenNode Version 3.10

    Stack is written in ANSI C in object-oriented way. Code is documented. License is LGPL. It includes Example for CANopen Input/Output device and simple CANopen master. Variables (communication, device...

    json-c lib

    JSON-C implements a reference counting object model that allows you to easily construct JSON objects in C, output them as JSON formatted strings and parse JSON formatted strings back into the C ...

    Inside ASP.NET

    C. ADO Common Object Reference DataSet Object DataTable Object DataColumn Object DataRow Class DataRelation Object DataView Object DataRowView Class OLEDBDATA Objects SQLData … ...

    Turbo C 2.00[DISK]

    WELCOME TO TURBO C 2.0 ---------------------- This README file contains important, last minute information about Turbo C 2.0. The HELPME!.DOC file on the COMMAND LINE/UTILITIES disk also answers ...

    a_byte_of_python

    it was written by Swaroop C H.its name is "a byte of python". Table of Contents Preface Who This Book Is For History Lesson Status of the book Official Website License Terms Using the ...

    MSSQL2005 INSERT,UPDATE,DELETE 之OUTPUT子句使用实例

    代码如下:–>Title:Generating test data –>Author:wufeng4552 –>Date :2009-10-07 15:16:26 if object_id(‘ta’)is not null drop table ta go create table ta(ID int identity,[name] varchar(10)) insert ta...

    Turbo C 2.01[DISK]

    WELCOME TO TURBO C 2.01 ----------------------- This README file contains important, last minute information about Turbo C 2.01. The HELPME!.DOC file on the COMPILER/UTILITIES disk also answers many...

Global site tag (gtag.js) - Google Analytics