码迷,mamicode.com
首页 >  
搜索关键字:nslog    ( 1220个结果
iOS沙盒路径
NSString *path = NSHomeDirectory();//主目录 NSLog(@"NSHomeDirectory:%@",path); NSString *userName = NSUserName();//与上面相同 NSString *rootPath ...
分类:移动开发   时间:2015-08-19 19:37:16    阅读次数:135
C语言中谓词的用法
NSArray*persons=@[jack,tom,rose,lucy,bob,john,lily];//指定谓词条件NSPredicate*pre1=[NSPredicatepredicateWithFormat:@"age<40"];for(Person*personinpersons){//条件匹配//验证对象是否符合谓词pre1BOOLbool1=[pre1evaluateWithObject:person];if(bool1){NSLog(@"%@",..
分类:编程语言   时间:2015-08-19 17:51:49    阅读次数:145
HelloWorld
1 NSLog(@"helloWorld");
分类:其他好文   时间:2015-08-19 13:14:05    阅读次数:127
IOS开发教程--NSLog输出格式控制
%@ Object %d, %i signed int %u unsigned int %f float/double %x, %X hexadecimal int %o octal int %zu size_t %p pointer %e float/double (in scientific notation) %g float/double (as %f or %e, de...
分类:移动开发   时间:2015-08-19 11:16:42    阅读次数:146
oc 字典
#import #import "AppDelegate.h"int main(int argc, char * argv[]) { //固定的字典类型 NSDictionary *dict=@{@"name":@"Netcorner",@"sex":@"male"}; NSLog...
分类:其他好文   时间:2015-08-18 15:47:26    阅读次数:311
时间格式字符串转化为date和时间戳
NSString *dateStr=@"2012-05-17 11:23:23"; NSLog(@"dateStr=%@",dateStr); NSDateFormatter *format=[[NSDateFormatter alloc] init]; [format setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; NSDate *f...
分类:其他好文   时间:2015-08-18 12:08:40    阅读次数:101
OC中 block 的用法
block 常用于反向传值 声明返回值类型 (^block)(参数列表) 调用闭包的名字=^(参数列表){}; 闭包的名字();如:void(^aaaaa)(int num,NSString *Sring); aaaaa=^(int num,NSString *string){ NSLog...
分类:其他好文   时间:2015-08-17 23:08:20    阅读次数:133
OC_NSString、
8月17日NSString一、字符串的创建 //1.创建常量字符串 NSString*str1 =@"hello world"; NSLog(@"%@",str1); //2.通过类方法创建字符串 NSString*str2 = [NSStringstringWithString:str1]; N....
分类:其他好文   时间:2015-08-17 21:31:39    阅读次数:85
Objective-C:NSString类的常见用法
几种常见的用法为:字符串的创建、字符串的搜索、字符串的比较、字符串的转换用途一:字符串的创建 1 void ex1() 2 { 3 //1.常量字符串的对象 4 NSString *str1 = @"hello world"; 5 NSLog(@"str1 = %@",str...
分类:其他好文   时间:2015-08-17 21:16:56    阅读次数:129
NSThread线程对象
NSThread创建线程的方式 准备在后台线程调用的方法 longOperation: - (void)longOperation:(id)obj { NSLog(@"%@ - %@", [NSThread currentThread], obj); }方式1:alloc / init - start- (void)threadDemo1 { NSLog(@"before %@",...
分类:编程语言   时间:2015-08-16 00:41:34    阅读次数:130
1220条   上一页 1 ... 61 62 63 64 65 ... 122 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!