使用正则表达式寻找字符串中出现了几个[***]样式的字符串源码如下:-
(NSUInteger)analyseRX:(NSString *)string withPatternString:(NSString
*)patternString{ // \\[[^\\]]+\\] 用以匹...
分类:
其他好文 时间:
2014-05-27 00:42:18
阅读次数:
245
查找资料的时候发现不错的文章,自己翻译之后分享给大家!一个基本的该类型字符串例子:@"This
is a constant character string object";在后台显示它:NSLog (@"%@", @"This is a constant
character string obje...
分类:
其他好文 时间:
2014-05-26 20:34:38
阅读次数:
278
//16进制颜色(html颜色值)字符串转为UIColor+(UIColor *)
hexStringToColor: (NSString *) stringToConvert{ NSString *cString =
[[stringToConvert stringByTrimmingCh...
分类:
移动开发 时间:
2014-05-26 08:43:21
阅读次数:
207
NSString *path = [[NSBundlemainBundle]
pathForResource:@"tmp_add"ofType:@"txt"]; NSString *aStr =
[NSStringstringWithContentsOfFile:path encoding:N...
分类:
移动开发 时间:
2014-05-26 08:15:58
阅读次数:
258
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,
0), ^{ NSString *urlString = @"http://img0.pconline.com.cn/pconline/1...
分类:
移动开发 时间:
2014-05-24 09:10:22
阅读次数:
324
-(UIButton *)shareButtonWithIcon:(NSString
*)iconName{ UIButton *button = [UIButtonbuttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(100.....
分类:
其他好文 时间:
2014-05-23 05:33:28
阅读次数:
221
std::string转NSString
std::string _string("hello");NSString *str= [NSString stringWithCString:_string.c_str() encoding:[NSString defaultCStringEncoding]];
NSString转std::string
NSString * ...
分类:
其他好文 时间:
2014-05-23 02:24:50
阅读次数:
201
简易计算器 一、将NSString类型转换成NSInteger类型 [text
integerValue]; //这个NSInteger类型在32/64位系统下能够自动转换所占字节数二、定义NSInteger类型数据:NSInteger
num = [text interValue]; //不需要*...
分类:
其他好文 时间:
2014-05-21 21:05:32
阅读次数:
311
1、NSProcessInfo常用方法:
+(NSProcessInfo*)processInfo //返回当前进程的信息
-(NSArray*)arguments //以NSString对象数组的形式返回当前进程的参数
-(NSDictionary *)environment //返回变量/值对词典,以描述当前的环境变量(比如PATH和HOME)及其值
-(int)processI...
分类:
其他好文 时间:
2014-05-21 17:16:15
阅读次数:
229
设置日期期限的时候下面这个方法用不了(升级成ios7之后)
NSDate *toDate =[[NSDate alloc]initWithString:@"2000-10-10 12:00:00 -0500"];
用下面的方法替换
NSDateFormatter * formatter = [[NSDateFormatter alloc]init];
[forma...
分类:
其他好文 时间:
2014-05-21 15:07:58
阅读次数:
240