//在字符串中,动态插入字符串
//由于返回来的链接"www.yousawang.com"中少了"/",故在"yousawang.com"后面加上"/"
NSMutableString *string_logo=[NSMutableString
stringWithString:user.Store_logo];
NSRange range = [string_logo...
分类:
其他好文 时间:
2014-11-27 18:33:29
阅读次数:
209
场景A控制器中有一个Label B控制器中有一个文本输入框textFieldA push 到B 当,B返回A时,我们让B中文本框的内容展示到A中去第一步: 在B中定义Block#import typedef void(^PassValueOption)(NSString*);@interface ....
分类:
移动开发 时间:
2014-11-27 18:06:10
阅读次数:
159
iOS - 正则表达式判断邮箱、身份证..是否正确://邮箱+ (BOOL) validateEmail:(NSString *)email{ NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; .....
分类:
移动开发 时间:
2014-11-27 12:00:54
阅读次数:
130
在iOS开发中,经常需要从后台数据中获取时间,但是此时后台返回的时间格式经常是一串类似"123456789"的数字,此数字是1970年开始截至到现在的秒数,此时我们需要将其转换为可以用的格式.模型中我定义了c_time属性,通过重写c_time的get方法中进行格式的转换.- (NSString *...
分类:
移动开发 时间:
2014-11-26 22:35:21
阅读次数:
325
- (NSDate
*)dateFromString:(NSString
*)dateString{
NSDateFormatter
*dateFormatter
=
[[NSDateFormatter
alloc]
init];
[dateFormatter
setDateFormat:
@"yyyy-MM-dd
H...
分类:
其他好文 时间:
2014-11-26 21:01:42
阅读次数:
207
1、获取本地的语言[cpp]view plaincopy+(NSString*)getLocalLanguage{NSString*language=[[[NSUserDefaultsstandardUserDefaults]objectForKey:@"AppleLanguages"]object...
分类:
移动开发 时间:
2014-11-26 16:22:36
阅读次数:
263
1,本地的html文件一定要放到工程文件的根目录2,html代码中的图片路径一定要是相对路径3,下面是用UIWebView调用本地文件的方法方法一:NSString*filePath = [[NSBundlemainBundle]pathForResource:@"1"ofType:@"html"]...
分类:
移动开发 时间:
2014-11-26 13:54:52
阅读次数:
144
//.pch//如果需要打印日志下行不注释,否:注释下行。#define __SHOW__NSLOG__#ifdef __SHOW__NSLOG__#define DebugLog( s, ... ) NSLog( @" %@", self, [[NSString stringWithUTF8Str...
分类:
其他好文 时间:
2014-11-26 13:47:58
阅读次数:
178
// 检查更新- (void)updateVersion{ // 获取app版本 NSDictionary *infoDictionary = [[NSBundlemainBundle] infoDictionary]; NSString *currentVersion = [infoDict...
分类:
其他好文 时间:
2014-11-26 13:34:27
阅读次数:
143
#import "UINavigationBar+CustomImage.h"@implementation UINavigationBar (CustomImage)-(UIImage *)drawImage:(NSString *)imageName{ UIImage *image = [U.....
分类:
其他好文 时间:
2014-11-26 13:31:37
阅读次数:
271