归档也叫序列化,是将文件存在硬盘,解码是从硬盘还原一、使用属性列表进行归档
如果对象是NSString,NSDictionary,NSArray,NSData,NSNumber,NSDate,可以是使用writeToFile:atomically方法将数据写到文件,注意这种方式是明文。
NS...
分类:
其他好文 时间:
2014-04-30 15:34:09
阅读次数:
396
//使用实例方法创建NSSting的对象 NSString*string1 =
[[NSStringalloc]initWithFormat:@"姓名:%@",@"hfjs"]; NSString*string2 =
[[NSStringalloc] initWithFormat:@"姓名"...
分类:
其他好文 时间:
2014-04-30 00:51:16
阅读次数:
553
主要需要注意的几个问题: 1.导入图片方式最好用文件导入 代码:
在ViewController.m文件中 2.UILable常用属性 @property(nonatomic,copy) NSString *text;
//设置文本内容 @...
分类:
移动开发 时间:
2014-04-29 22:28:37
阅读次数:
616
- (UITableViewCell *)tableView:(UITableView
*)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString
*cellindentifier=@"...
分类:
移动开发 时间:
2014-04-29 19:55:42
阅读次数:
604
使用字典的坏处一般情况下,设置数据和取出数据都使用“字符串类型的key”,编写这些key时,编译器不会有任何友善提示,需要手敲dict[@"name"] =
@"Jack";NSString *name = dict[@"name"];手敲字符串key,key容易写错Key如果写错了,编译器不会有任...
分类:
移动开发 时间:
2014-04-29 17:21:47
阅读次数:
525
一个完整的通知一般包含3个属性:- (NSString *)name; // 通知的名称-
(id)object; // 通知发布者(是谁要发布通知)- (NSDictionary *)userInfo; //
一些额外的信息(通知发布者传递给通知接收者的信息内容)初始化一个通知(NSNotific...
分类:
其他好文 时间:
2014-04-29 17:12:47
阅读次数:
274
1.添加元素的时候,先取出数组,再向数组中添加元素:-
(void)addPeason:(AddressPeason*)peason{
if(![[peasongetName]isEqualToString:nil]) {
for(NSString*stringin[_peasonDiction.....
分类:
其他好文 时间:
2014-04-29 11:22:45
阅读次数:
535
访问项目中资源包里面所有资源使用方法。读取资源包descs.plist文件方法如下:NSBundle *bundle = [NSBundle
mainBundle]; //创建bundle对象NSString *path = [bundle pathForResourc...
分类:
其他好文 时间:
2014-04-28 16:14:50
阅读次数:
349
--->12\n%@", [[NSString
stringWithUTF8String:__FILE__] lastPathComponent],__LINE__,__PRETTY_FUNCTION__ ,
[NSString stringWithFormat:(s), ##__VA_ARGS__...
分类:
移动开发 时间:
2014-04-28 15:19:16
阅读次数:
579
#import "RootViewController.h"@interface
RootViewController ()@end@implementation RootViewController-
(id)initWithNibName:(NSString *)nibNameOrNil bun...
分类:
移动开发 时间:
2014-04-28 15:11:25
阅读次数:
656