iOS开发之 Objective-C语言基础 :代码块
2016-02-22 15:54
609 查看
#import <Foundation/Foundation.h>
typedef void (^SayHello)();
int (^max)(int a,int b);
typedef void (^SayHello)();
int main(int argc,
const char * argv[]) {
@autoreleasepool {
SayHello sh=^(){
printf(" programing is very fun ……\n");
};
sh();
max =^(int a ,int b){
return a>b?a:b;
};
NSLog(@"\n the max is :%d\n",max(7,1));
}
return 0;
}
typedef void (^SayHello)();
int (^max)(int a,int b);
typedef void (^SayHello)();
int main(int argc,
const char * argv[]) {
@autoreleasepool {
SayHello sh=^(){
printf(" programing is very fun ……\n");
};
sh();
max =^(int a ,int b){
return a>b?a:b;
};
NSLog(@"\n the max is :%d\n",max(7,1));
}
return 0;
}
相关文章推荐
- GitHub 上排名前 100 的 Objective-C 项目简介
- Objective-C中的Block
- 保存自定义对象 archivedDataWithRootObject unarchiveObjectWithData
- QT 控件和ID绑定 QObjectUserData
- magent 启动时error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: N
- Objective C运行时总结
- Java对象序列化ObjectOutputStream和ObjectInputStream示例
- <NSCoding>存储数据 archivedDataWithRootObject unarchiveObjectWithData
- Android开发之View.setTag(Object tag)
- You Only Look Once:Unified, Real-Time Object Detection论文笔记
- 在PB中使用OLEObject操作Excel
- objective c 字符串各种处理
- [Immutable.js] Using fromJS() to Convert Plain JavaScript Objects into Immutable Data
- 理解 Objective-C Runtime
- Objective-C Runtime
- 一分钟看懂NSAttributedString
- ZigBee Device Object Bind Request
- ZigBee Device Object End Device Bind Request--协调器与终端之间的绑定
- 021: class, objects and instance: 特殊方法
- Android 实现可以暂停旋转的ObjectAnmition动画