1,仅加载图片,图像数据不会缓存。NSString *path = [[NSBundle mainBundle] pathForResource:@”icon” ofType:@”png”]; UIImage *image = [UIImage imageWithContentsOfFile:pa....
分类:
其他好文 时间:
2014-06-28 11:43:47
阅读次数:
177
一、判断上次用的版本和这次用的版本是否一样 在AppDelegate.m中的didFinishLaunchingWithOption方法中添加如下代码// 1.从Info.plist中获取版本号String *versionKey = (NSString *)kCFBundleVersionKey....
分类:
其他好文 时间:
2014-06-28 10:53:07
阅读次数:
186
//判断密码6-16位+ (BOOL)validatePassword:(NSString *)password{ NSString *Regex = @"^[a-zA-Z0-9]{5,16}$"; NSPredicate *emailTest = [NSPredicate pr...
分类:
移动开发 时间:
2014-06-26 23:34:10
阅读次数:
258
_textView =[UITextView new]; NSString*str =@"是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是"; NSMutableAttributedString *attributedString = [[NSMutableAtt.....
分类:
移动开发 时间:
2014-06-26 00:39:24
阅读次数:
352
/--------操作字符串--NSString(静态字符串)---------------------NSString * a = @"a+b+c+a+b+d"; NSArray * m = [a componentsSeparatedByString:@"+"];//字符串根据某个字串拆分...
分类:
其他好文 时间:
2014-06-25 16:10:18
阅读次数:
142
NSString的常用方法创建一个新字符串并将其设置为 path 指定的文件的内容,使用字符编码enc,在error上返回错误+ (id)stringWithContentsOfURL:(NSURL *)url encoding:(NSStringEncoding)enc error:(NSErro...
分类:
其他好文 时间:
2014-06-25 14:37:29
阅读次数:
164
http://www.2cto.com/kf/201402/281501.html123456NSString *str = @"0xff055008";//先以16为参数告诉strtoul字符串参数表示16进制数字,然后使用0x%X转为数字类型unsigned long red = strtoul...
分类:
移动开发 时间:
2014-06-24 19:43:58
阅读次数:
248
-(void)downImage{ AlbumInfo *info = [self.dataArray objectAtIndex:index]; NSString *filePath = [[SandBoxPath pathForCaches]stringByAppendingPathComp.....
分类:
其他好文 时间:
2014-06-24 10:59:35
阅读次数:
231
需要写入的对象必须实现NSCoding protocol
Person.h
#import
#import "Face.h"
@interface Person : NSObject
@property (nonatomic, strong) NSString *personId;
@property (nonatomic, strong) NSString *n...
分类:
其他好文 时间:
2014-06-22 08:00:31
阅读次数:
216