- 浏览: 469154 次
- 性别:
- 来自: 广州
-
文章分类
- 全部博客 (538)
- C/C++ Primer (69)
- Objective-C Primer (102)
- Python Primer (19)
- JavaScript Primer (1)
- Java Primer (37)
- PHP Primer (17)
- 泛 Linux (37)
- Shell Script (21)
- APUE (21)
- UNP__1&2 (19)
- NetWork (7)
- Oracle周边 (38)
- Mysql里边 (6)
- Windows技 (9)
- 简单算法 & 数据结构 (14)
- 设计模式 (6)
- GTK历程 (12)
- 工具使用 (25)
- 杂事 (23)
- 一些概念 (17)
- Web方面 (10)
- myCodeTools (9)
- ^未 竟$ (13)
- 硬件通信 (2)
- Games (1)
最新评论
SQLine Demo:http://www.wuleilei.com/blog/264
NSKeyedUnarchiverhttp://285746555.blog.51cto.com/2966432/647312
NSValue、CGPoint 序列化的问题等
- 文件、属性列表
- 对象归档
- SQLite
- Core Data
NSUserDefaults
NSFileHandle
NSFileManager
NSUserDefaults
NSString * msg = [NSString stringWithFormat:@"%d : %@\n", i, [NSDate date]]; NSString * path = 。。。; NSFileHandle *fh = [NSFileHandle fileHandleForWritingAtPath:path]; [fh seekToEndOfFile]; [fh writeData:[msg dataUsingEncoding:NSUTF8StringEncoding]]; [fh closeFile];
[NSFileManager defaultManager]//单例
[[NSFileManager alloc]init] // 线程安全
// NSFileManager的方法介绍
http://apps.hi.baidu.com/share/detail/38263560
// 遍历文件、目录
http://kevin-wu.net/tips-for-using-nsfilemanager-to-get-filefolder-list/
// 文件排序
http://www.acwind.net/blog/?p=1116
NSUserDefaults
http://www.cnblogs.com/zengwu/archive/2011/02/25/1964908.html
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:@"111" forKey:@"myTest"]; [defaults synchronize];//写入disk NSString *testStr = [defaults objectForKey:@"myTest"];//再次读出 NSLog(@"testStr is: %@",testStr); NSString * path = [[NSBundle mainBundle] pathForResource:@"default" ofType:@"json"];
第8章枚举目录
#import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { // 可变的Array NSMutableArray *files = [NSMutableArray arrayWithCapacity:0]; // 目录管理对象 NSFileManager *manager = [NSFileManager defaultManager]; // ~ 用户主目录 NSString *homeDir = [@"~" stringByExpandingTildeInPath]; NSDirectoryEnumerator *dirEnum = [manager enumeratorAtPath:homeDir]; // 枚举文件 for (NSString *fileName; fileName = [dirEnum nextObject];) { if ([[fileName pathExtension] isEqualTo:@"jpg"]) { [files addObject:fileName]; } } // 快速枚举 for (NSString *fileName in files) NSLog(@"%@", fileName); /* //普通枚举 NSEnumerator *fileEnum = [files objectEnumerator]; while (fileName = [fileEnum nextObject]) { NSLog(@"%@", fileName); } */ return 0; }
第三章读文件
#import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSLog(@"file path = %s",argv[1]); FILE *file = fopen(argv[1], "r"); char buf[128] = {0}; while (fgets(buf, 128, file)) { buf[strlen(buf) - 1] = '\0'; NSLog(@"length = %d,content = %s",strlen(buf), buf); } return 0; }
发表评论
-
float equal
2013-05-23 18:21 844- (BOOL)floatA:(float)f1 equalB ... -
Coding Guidelines for Cocoa
2013-05-17 16:53 693参考: https://developer.apple.com ... -
Cell
2013-05-16 14:32 804- (void)tableView:(UITableView ... -
Object-C编程规范
2013-05-15 10:49 7551.参考苹果的文档 “Coding Guidelines fo ... -
MacPorts
2013-02-28 18:12 629http://blog.csdn.net/lynjay/art ... -
KVC/KVO 监听对象属性变化
2013-01-10 23:09 7426http://blog.csdn.net/a6472953/a ... -
ios Associative 扩展属性
2013-01-08 16:45 1572@dynamic和@synthesize http://blo ... -
ObjC Dynamic
2013-01-08 15:21 790原文:http://www.onevcat.com/2012/ ... -
UITableView & UITextField
2012-11-08 00:35 857keyboard event ---------------- ... -
UIWebView
2012-10-24 11:06 771http://hi.baidu.com/wei_1123/it ... -
Device orientation
2012-10-15 16:20 770- (BOOL)shouldAutorotateToInter ... -
system notification
2012-10-12 15:22 646for UIApplication These notifi ... -
NSZombies
2012-08-09 08:51 685NSZombies搞定EXC_BAD_ACCESS http: ... -
Quartz 2D Programming Guide
2012-07-17 00:51 619Quartz 2D 内容不少啊 Graphics Trans ... -
NSCache
2012-07-12 14:25 782http://thenewself.blog.163.com/ ... -
NSCoding
2012-07-12 13:39 990@protocol NSCoding - (void ... -
分析 crash 报告的方法
2012-07-12 01:15 609http://blog.csdn.net/toss156/ar ... -
Multi-touch
2012-07-11 23:33 746智能与灵活与工作量>_< http://www.o ... -
iOS的多核编程和内存管理
2012-07-11 18:14 732http://anxonli.iteye.com/blog/1 ... -
NSCopying
2012-07-10 15:54 536http://www.apple.com.cn/develop ...
相关推荐
Easy Save v3.3.2 unity 插件 简单保存
存档读档的插件,使用确实挺方便。而且支持不止对数据对存储,包括类对象、资源文件等。
The TLK1221 performs the data serialization, deserialization, and clock extraction functions for a physical layer interface device. The transceiver operates at 1.25 Gbps (typical), providing up to 1 ...
febird implemented a serialization framework(vs boost.serialization/google.protocolbuffer), can be used in protocol parsing, big/small data serialization, even in very small object serialize, ...
Learn two data formats: Avro for data serialization and Parquet for nested data Use data ingestion tools such as Flume (for streaming data) and Sqoop (for bulk data transfer) Understand how high-level...
Dive into key topics in network architecture and Go, such as data serialization, application level protocols, character sets and encodings. This book covers network architecture and gives an overview ...
* Avoiding hidden portability pitfalls associated with floating point, char types, data serialization, and types in C++ * Utilizing platform abstraction libraries such as the Netscape Portable ...
- Dataserialization—working with text and beyond:数据序列化的概念和应用,这涉及如何处理不同类型的数据,不仅仅是文本数据。 - Big Data Patterns:应用MapReduce解决大数据问题的模式,以及优化HDFS性能的...
The author then discusses the exchange of data in WCF service operation features, related to WCF data serialization. You will discover some useful tips for security in WCF service development and ...
- 在数据物流部分,提到了将数据“Moving data in and out of Hadoop”(进出Hadoop的数据移动),以及“Data serialization—working with text and beyond”(数据序列化—处理文本及更多),意味着书中可能会介绍...
在`System.Runtime.Serialization`中,可以通过设置各种特性来控制序列化行为,如`[IgnoreDataMember]`用于排除某个成员,`[DataMember(Order = int)]`用于指定成员的序列化顺序,`[OnSerializing]`和`[OnSerialized...
deserialized_data = serialization.loads(json_data, 'json') print(deserialized_data) # 输出:{'name': 'Jane', 'age': 28} # pickle 序列化 pickle_data = serialization.dumps(data, 'pickle') # pickle 反...
2. **数据序列化(Data Serialization)**: `serialize()`方法可将表单数据序列化为URL编码格式,便于发送Ajax请求。 ### 五、jQuery插件与扩展 jQuery的生态系统包括大量插件,如Bootstrap、jQuery UI等,它们...
- **Data Serialization:** Flask-RESTful or Flask-RESTPlus are popular choices for building APIs that serialize data to JSON or XML. ##### Performance and Testing - **Unit Tests:** Running unit tests ...
3. uart_baut_dsout.vhd:这个文件可能涉及到波特率发生器的输出和数据串行化(data serialization)。波特率发生器的输出驱动数据串行化过程,将并行数据转换为串行数据流,准备好发送出去。 4. uart_tx.vhd:这是...