摘要: 此处我把json数据中的null转换成了@"",防止出现null程序崩掉,可以把下边宏代码复制到pch中,就可以在整个程序中引用了 #define DSStringValue(value)\({id tmp;\if ([value isKindOfClass:[NSNull class]]){\tm 阅读全文
posted @ 2017-04-22 11:56 弋小木 阅读(279) 评论(0) 推荐(0) 编辑
摘要: num1与num2之间的随机数 -(float)randomFloatBetween:(float)num1 andLargerFloat:(float)num2{ int startVal = num1*10000; int endVal = num2*10000; int randomValue 阅读全文
posted @ 2017-04-21 11:54 弋小木 阅读(772) 评论(0) 推荐(0) 编辑
摘要: - (NSURLRequest *)addHeaderRequestWithUrl:(NSString *)urlStr{ NSMutableURLRequest *mutableRequest = [[NSMutableURLRequest alloc] initWithURL:[NSURL UR 阅读全文
posted @ 2017-04-21 10:22 弋小木 阅读(1910) 评论(0) 推荐(0) 编辑
摘要: 金融类app防止信息在后台中被一些恶意截屏软件进行截屏,对进入后台的app做模糊处理 - (void)applicationWillResignActive:(UIApplication *)application { //进入后台盖上view,实现模糊效果 UIView* view = [[UIV 阅读全文
posted @ 2017-04-21 10:15 弋小木 阅读(2669) 评论(0) 推荐(0) 编辑
摘要: 在appdelegate中- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions方法中加入下面代码 NSString *oldUserAg 阅读全文
posted @ 2017-04-21 10:07 弋小木 阅读(1679) 评论(0) 推荐(0) 编辑
摘要: //获取验证码接口+ (NSDictionary *)getPhoneCodeWithPhoneWithParamDict:(NSDictionary *)paramDict vertifyButton:(UIButton *)vertifyButton urlStr:(NSString *)url 阅读全文
posted @ 2017-04-21 10:04 弋小木 阅读(242) 评论(0) 推荐(0) 编辑
摘要: //json格式字符串转字典+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString { if (jsonString == nil) { return nil; } NSData *jsonData = [jsonStrin 阅读全文
posted @ 2017-04-21 10:03 弋小木 阅读(715) 评论(0) 推荐(0) 编辑
摘要: +(NSString *)getNewBankNumWitOldBankNum:(NSString *)bankNum{ NSMutableString *mutableStr; if (bankNum.length) { mutableStr = [NSMutableString stringWi 阅读全文
posted @ 2017-04-21 10:01 弋小木 阅读(2341) 评论(0) 推荐(0) 编辑
摘要: +(void)clearCache{ NSHTTPCookie *cookie; NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; for (cookie in [storage cookies 阅读全文
posted @ 2017-04-21 10:01 弋小木 阅读(325) 评论(0) 推荐(0) 编辑
摘要: 为了方便阅读,app中的金额需要用,隔开 //数字3个字一个逗号隔开,如:1,000.98+ (NSString *)separatePer3WithNumStr:(NSString *)numStr{ double oldf = [numStr doubleValue]; long long ol 阅读全文
posted @ 2017-04-21 09:59 弋小木 阅读(1639) 评论(0) 推荐(0) 编辑