摘要: 了解反射机制 Objective-C语言中的OC对象,都继承自NSObject类。这个类为我们提供了一些基础的方法和协议,我们可以直接调用从这个类继承过来方法。当然,本篇文章中讲到的反射方法,就在NSObject和Foundation框架中。 反射机制涉及到的东西比较多,这篇文章只从OC层面来讲反射 阅读全文
posted @ 2016-08-19 17:28 J-Vijay 阅读(487) 评论(0) 推荐(0)
摘要: Xcode 升级后,常常遇到的遇到的警告、错误,解决方法 阅读全文
posted @ 2016-08-19 13:36 J-Vijay 阅读(704) 评论(0) 推荐(0)
摘要: 初学XCode最让人头疼的就是项目各属性设置,各种不解,这里做个总结: 项目配置: 基本项(Basic) 1、Architectures(指令集)——设置你想支持的指令集,目前ios的指令集有以下几种: (1)armv6,支持的机器iPhone,iPhone2,iPhone3G及对应的iTouch 阅读全文
posted @ 2016-08-19 13:25 J-Vijay 阅读(710) 评论(0) 推荐(0)
摘要: __weak typeof(self) weakSelf = self; UIView * tempView = [[UIView alloc]init]; NSInteger count = 10;//设置一排view的个数 NSInteger margin = 10;//设置相隔距离 NSInteger height = 50;//设置view的高... 阅读全文
posted @ 2016-08-19 11:36 J-Vijay 阅读(157) 评论(0) 推荐(0)
摘要: //修改导航栏文字字体和颜色 nav.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[RGBColor colorWithHexString:@"#4b95f2"],NSFontAttributeName:[UIFont boldSystemFontOfSize:20]}; //修改导航栏颜色... 阅读全文
posted @ 2016-08-19 11:34 J-Vijay 阅读(1246) 评论(0) 推荐(0)
摘要: 1.CocoaPods的安装及使用: http://code4app.com/article/cocoapods-install-usage http://objccn.io/issue-6-4/ http://www.jianshu.com/p/5fc15906c53a 查看当前的源 gem so 阅读全文
posted @ 2016-08-19 11:33 J-Vijay 阅读(131) 评论(0) 推荐(0)
摘要: 创建继承于UIView的类WJImageScrollView,代码实现如下: WJImageScrollView.h WJImageScrollView.m 使用方法 能解决问题的不好的方法释放view 阅读全文
posted @ 2016-08-19 11:31 J-Vijay 阅读(1067) 评论(0) 推荐(0)
摘要: CLLocation *orig=[[[CLLocation alloc] initWithLatitude:[mainDelegate.latitude_self doubleValue] longitude:[mainDelegate.longitude_self doubleValue]] autorelease]; CLLocation* dist=[[[CLLocation al... 阅读全文
posted @ 2016-08-19 11:30 J-Vijay 阅读(223) 评论(0) 推荐(0)
摘要: 监听时间点击 改变当前浏览器窗口地址 在js里调用OC代码,需要在网页上写一个协议,不是http协议 然后在OC的webView shouldStartloadWithRequest 阅读全文
posted @ 2016-08-19 11:28 J-Vijay 阅读(132) 评论(0) 推荐(0)
摘要: /一个section刷新 NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2]; [tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic]; //一个cell刷新 NSIndexPath *i... 阅读全文
posted @ 2016-08-19 11:28 J-Vijay 阅读(7150) 评论(0) 推荐(2)
摘要: 一、底层实现 1、AFN的底层实现基于OC的NSURLConnection和NSURLSession 2、ASI的底层实现基于纯C语言的CFNetwork框架 3、因为NSURLConnection和NSURLSession是在CFNetwork之上的一层封装,因此ASI的运行性能高于AFN 二、对 阅读全文
posted @ 2016-08-19 11:24 J-Vijay 阅读(219) 评论(0) 推荐(0)
摘要: 移动应用在处理网络资源时,一般都会做离线缓存处理,其中以图片缓存最为典型,其中很流行的离线缓存框架为SDWebImage。但是,离线缓存会占用手机存储空间,所以缓存清理功能基本成为资讯、购物、阅读类app的标配功能。今天介绍的离线缓存功能的实现,主要分为缓存文件大小的获取、删除缓存文件的实现。 获取 阅读全文
posted @ 2016-08-19 11:21 J-Vijay 阅读(244) 评论(0) 推荐(0)
摘要: CAKeyframeAnimation* animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; animation.duration = 1; NSMutableArray *values = [NSMutableArray array]; [values addObject:[NSValue valueWith... 阅读全文
posted @ 2016-08-19 10:37 J-Vijay 阅读(666) 评论(0) 推荐(0)
摘要: /** 替换关键字的属性名 */ + (NSDictionary *)mj_replacedKeyFromPropertyName{ return @{@"UUID":@"id"}; } +(NSDictionary *)mj_objectClassInArray{ return @{@"result":[PicDetailsItemsModel class]}; } 阅读全文
posted @ 2016-08-19 10:36 J-Vijay 阅读(634) 评论(0) 推荐(0)
摘要: 下面方法可以将文本复制到剪切板 UIPasteboard *pboard = [UIPasteboard generalPasteboard]; pboard.string = @"邀请码"; 阅读全文
posted @ 2016-08-19 10:35 J-Vijay 阅读(1710) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2016-08-19 10:34 J-Vijay 阅读(131) 评论(0) 推荐(0)
摘要: NSMutableAttributedString * attrString =[[NSMutableAttributedString alloc] initWithData:[resultModel.tips dataUsingEncoding:NSUnicodeStringEncoding]options:@{NSDocumentTypeDocumentAttribute: NSHTMLTe... 阅读全文
posted @ 2016-08-19 10:32 J-Vijay 阅读(2645) 评论(0) 推荐(0)
摘要: NSAttributedString *attrStr =[[NSAttributedString alloc]initWithString:[NSString stringWithFormat:@"¥%@", resultModel.originalprice]attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12],NSFor... 阅读全文
posted @ 2016-08-19 10:30 J-Vijay 阅读(260) 评论(0) 推荐(0)
摘要: - (void)webViewDidFinishLoad:(UIWebView *)wb{ //方法1 CGFloat documentWidth = [[wb stringByEvaluatingJavaScriptFromString:@"document.getElementById('content').offsetWidth"] floatValue]; CGFloat docume... 阅读全文
posted @ 2016-08-19 10:29 J-Vijay 阅读(1484) 评论(0) 推荐(0)
摘要: NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"xiaoli" ofType:@"plist"]; NSMutableDictionary *dataDictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 写plist N... 阅读全文
posted @ 2016-08-19 10:28 J-Vijay 阅读(100) 评论(0) 推荐(0)