Gavin.han

致力于移动开发 技术改变生活

导航

2012年10月28日

摘要: 通过plist文件存取文件在ios文件处理(一)的项目中,修改HomeViewController.m的viewDidLoad方法- (void)viewDidLoad{/* NSString *fileName = [[self documentsPath] stringByAppendingPathComponent:@"content.txt"]; //NSString *fileName = [[self tempPath] stringByAppendingPathComponent:@"content.txt"]; [self writeTo 阅读全文

posted @ 2012-10-28 17:10 gavin.han 阅读(489) 评论(0) 推荐(0) 编辑

摘要: 一.在Documents、tmp和Library中存储文件Documents:用于存储应用程序中经常需要读取或写入的常规文件。tmp:用于存储应用程序运行时生成的文件。(随着应用程序的关闭失去了利用价值)Library:一般存放应用程序的配置文件,比如说plist类型的文件。二.读取和写入文件 1.新建Empty Application应用程序,添加HomeViewController文件HomeViewController.h代码:#import <UIKit/UIKit.h>@interface HomeViewController : UIViewController{ }- 阅读全文

posted @ 2012-10-28 16:19 gavin.han 阅读(1474) 评论(2) 推荐(2) 编辑

摘要: 通过两种方法来实现:一、通过动态数组NSMutableArray中的数据,来显示数据1.新建Empty Application项目,新建ViewController,HomeViewController,在AppDelegate.m中导入该文件,并在方法- (BOOL)application:didFinishLaunchingWithOptions:中添加以下红色标记的代码- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ . 阅读全文

posted @ 2012-10-28 13:06 gavin.han 阅读(9866) 评论(0) 推荐(2) 编辑