码迷,mamicode.com
首页 >  
搜索关键字:nsstring    ( 4622个结果
加载图片时的2种方法
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
IOS7图文混排及高度
_textView =[UITextView new]; NSString*str =@"是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是是"; NSMutableAttributedString *attributedString = [[NSMutableAtt.....
分类:移动开发   时间:2014-06-26 00:39:24    阅读次数:352
OC中的那些String
/--------操作字符串--NSString(静态字符串)---------------------NSString * a = @"a+b+c+a+b+d"; NSArray * m = [a componentsSeparatedByString:@"+"];//字符串根据某个字串拆分...
分类:其他好文   时间:2014-06-25 16:10:18    阅读次数:142
NSString 的常用方法
NSString的常用方法创建一个新字符串并将其设置为 path 指定的文件的内容,使用字符编码enc,在error上返回错误+ (id)stringWithContentsOfURL:(NSURL *)url encoding:(NSStringEncoding)enc error:(NSErro...
分类:其他好文   时间:2014-06-25 14:37:29    阅读次数:164
iOS中NSString转换成HEX(十六进制)-NSData转换成int
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
怎样把SEL放进NSArray里
本文介绍了SEL与NSString的相互转化。
分类:其他好文   时间:2014-06-24 11:31:20    阅读次数:200
下载图片,
-(void)downImage{ AlbumInfo *info = [self.dataArray objectAtIndex:index]; NSString *filePath = [[SandBoxPath pathForCaches]stringByAppendingPathComp.....
分类:其他好文   时间:2014-06-24 10:59:35    阅读次数:231
NSUserDefaults写入和读取自定义的对象
需要写入的对象必须实现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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!