iPhone开发-创建、读取、写入文件
?
?
?? //获取数据?
?? NSData *reader = [NSData dataWithContentsOfFile:path];
?
?? //获取字节的个数
??? int length = [reader length];
??? NSLog(@"------->bytesLength:%d", length);
??? for(int i = 0; i < length; i++)
??? {
??????? //读取数据
??? ??? [reader getBytes:&b range:NSMakeRange(i, sizeof(b))];
??? ??? NSLog(@"-------->data%d:%d", i, b);????
?
??? }
?