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
_textView =[UITextView new]; NSString*str =@"是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是"; NSMutableAttributedString *attributedString = [[NSMutableAtt.....
分类:
移动开发 时间:
2014-06-26 00:39:24
阅读次数:
352
最近一个公司一个项目里有个坑,显示不了0点的数据,修改起始时间为前一天23点59分59秒则可以显示。 查看了获取当天0点代码,和网上查到的结果基本一致,如下所示(使用Category On NSDate):1 - (NSDate *)zeroOfDate2 {3 NSCalendar ...
分类:
移动开发 时间:
2014-06-25 20:14:27
阅读次数:
194
/--------操作字符串--NSString(静态字符串)---------------------NSString * a = @"a+b+c+a+b+d"; NSArray * m = [a componentsSeparatedByString:@"+"];//字符串根据某个字串拆分...
分类:
其他好文 时间:
2014-06-25 16:10:18
阅读次数:
142
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
iOS Dev (55) 获取当前年、月、日等信息
作者:大锐哥博客:http://prevention.iteye.com
-
NSDate *now = [NSDate date];
NSCalendar *calendar = [NSCalendar currentCalendar];
NSUInteger unitFlags =
NSYearCalendarUnit...
分类:
移动开发 时间:
2014-06-22 22:39:27
阅读次数:
291
需要写入的对象必须实现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