摘要: 代码: 1 #import 2 3 int main(int argc, const char * argv[]) { 4 @autoreleasepool { 5 //创建空数组 6 NSArray *arr1=[[NSArray alloc]init]... 阅读全文
posted @ 2016-01-07 11:07 零点五 阅读(1035) 评论(0) 推荐(0) 编辑
摘要: 代码: 1 #import 2 3 int main(int argc, const char * argv[]) { 4 @autoreleasepool { 5 NSMutableString *mustr1=[[NSMutableString alloc]init]... 阅读全文
posted @ 2016-01-07 10:53 零点五 阅读(1258) 评论(0) 推荐(0) 编辑
摘要: 代码:(涉及到一部分NSArray的知识) 1 #import 2 3 int main(int argc, const char * argv[]) { 4 @autoreleasepool { 5 int a=345,b=789,c=123,d=567; 6 ... 阅读全文
posted @ 2016-01-07 08:45 零点五 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 方法1:取出字符串中的数字#import int main(int argc, const char * argv[]) { @autoreleasepool { NSString *strOriginal=@"123-456-789-000"; NSRange r... 阅读全文
posted @ 2016-01-07 08:43 零点五 阅读(372) 评论(0) 推荐(0) 编辑
摘要: 代码:#import int main(int argc, const char * argv[]) { @autoreleasepool { NSString *str1=@"158",*str2=@"39"; int num1=[str1 intValue]; ... 阅读全文
posted @ 2016-01-07 08:40 零点五 阅读(184) 评论(0) 推荐(0) 编辑
摘要: main: 1 #import 2 #import "Location.h" 3 #import "Rectangle.h" 4 5 int main(int argc, const char * argv[]) { 6 @autoreleasepool { 7 Loca... 阅读全文
posted @ 2016-01-06 20:52 零点五 阅读(229) 评论(0) 推荐(0) 编辑
摘要: main: 1 #import 2 #import "Animal.h" 3 #import "Fish.h" 4 #import "Bird.h" 5 6 void doAction(Animal *ani) 7 { 8 [ani action]; //用父... 阅读全文
posted @ 2016-01-06 20:49 零点五 阅读(170) 评论(0) 推荐(0) 编辑
摘要: #define NSLog(FORMAT, ...) printf("%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String])只需要在#import之前添加以上代码,就可以去掉讨厌的时间戳和进程ID啦~ 阅读全文
posted @ 2016-01-06 20:42 零点五 阅读(175) 评论(0) 推荐(0) 编辑
摘要: #import int main(int argc, const char * argv[]) { @autoreleasepool { int a=6; float b=7.8; double d=5.6; NSInteger c=9;... 阅读全文
posted @ 2016-01-06 20:37 零点五 阅读(425) 评论(0) 推荐(0) 编辑
摘要: 1 #import 2 3 int main(int argc, const char * argv[]) { 4 @autoreleasepool { 5 //判断字符串前缀 6 NSString *str1=@"iOS-study"; 7 ... 阅读全文
posted @ 2016-01-06 20:26 零点五 阅读(2319) 评论(0) 推荐(0) 编辑