随笔分类 -  iOS tips

摘要:方法一: 代码如下,如有更好的方法 麻烦贴出来,这个方法是通过webview进行解码的 UIWebView *web = [[UIWebView alloc] init]; NSString *tsw = @"%E4%B8%AD%E5%9B%BD"; NSString *sc = [NSString 阅读全文
posted @ 2016-07-13 17:59 小屁孩~ 阅读(1309) 评论(0) 推荐(0)
摘要:例:123456789 结果:123,456,789 阅读全文
posted @ 2016-07-13 10:31 小屁孩~ 阅读(2788) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/lwjok2007/article/details/47058795 阅读全文
posted @ 2016-07-06 10:19 小屁孩~ 阅读(105) 评论(0) 推荐(0)
摘要:标志 值 含义 NULL (void *)0 C指针的字面零值 nil (id)0 Objecve-C对象的字面零值 Nil (Class)0 Objecve-C类的字面零值 NSNull [NSNull null] 用来表示零值的单独的对象 阅读全文
posted @ 2016-06-28 21:39 小屁孩~ 阅读(142) 评论(0) 推荐(0)
摘要:服务端返回的urlString里面有时含有中文,使用 [NSURL URLWithString:urlString]生成URL对象时,iOS客户端不能正确进行网络请求,网上找到的URLEncode方法又不能完全解决问题. 方法1: NSString* encodedString = [urlStri 阅读全文
posted @ 2016-06-23 21:59 小屁孩~ 阅读(3550) 评论(0) 推荐(0)
摘要:博客地址1:http://www.cocoachina.com/ios/20150415/11568.html 博客地址2:http://www.admin10000.com/document/5944.html 阅读全文
posted @ 2016-06-13 15:21 小屁孩~ 阅读(254) 评论(0) 推荐(0)
摘要://身份证号验证 1900+/2000+的年份日期的正则表达式经过修改,目前貌似是对的,如果哪位朋友发现错误希望能够给与提示 //返回yes位表示格式正确,否则为错误 -(BOOL)IDCardAuth:(NSString *)value { //stringByTrimmingCharactersInSet :去除字符串中的特殊字符 //[NSCharacterSet whit... 阅读全文
posted @ 2016-06-13 14:27 小屁孩~ 阅读(932) 评论(0) 推荐(0)
摘要:- (void)scrollToBottom { NSInteger sectionCount = [self.dataSource numberOfSectionsInTableView:self]; NSInteger lastSectionRowCount = [self.dataSource tableView:self numberOfRowsInSection:sec... 阅读全文
posted @ 2016-06-12 14:44 小屁孩~ 阅读(1697) 评论(0) 推荐(0)
摘要:category和associative作为objective-c的扩展机制的两个特性,category用来扩展类的方法,associative可以用来扩展类的属性。使用associative需要导入<objc/runtime.h>文件。 他有三个方法1.设置关联对象 objc_setAssocia 阅读全文
posted @ 2016-06-04 15:37 小屁孩~ 阅读(243) 评论(0) 推荐(0)
摘要:下载Git工具:下载链接 https://git-scm.com/downloads/ 然后配置Git:配置教程链接 http://jingyan.baidu.com/article/ceb9fb10b918a48cac2ba07d.html 最后安装GitHub DeskTop : 教程链接 ht 阅读全文
posted @ 2016-06-02 14:10 小屁孩~ 阅读(698) 评论(0) 推荐(0)
摘要:encode 根据需要可以使用GBK的中文编码,不需要中文的话可以使用UTF-8编码 阅读全文
posted @ 2016-06-01 13:52 小屁孩~ 阅读(531) 评论(0) 推荐(0)
摘要:转至 http://blog.csdn.net/guo_hongjun1611/article/details/7839371 使用UIBezierPath类可以创建基于矢量的路径,这个类在UIKit中。此类是Core Graphics框架关于path的一个封装。使用此类可以定义简单的形状,如椭圆或 阅读全文
posted @ 2016-05-13 15:01 小屁孩~ 阅读(305) 评论(0) 推荐(0)
摘要:#pragma mark - 编辑完成 -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [self.view endEditing:YES]; } -(BOOL)textFieldShouldReturn:(UITextField *)textField { [self.view endEdit... 阅读全文
posted @ 2016-05-10 18:14 小屁孩~ 阅读(106) 评论(0) 推荐(0)
摘要:- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ if ([segue.destinationViewController isKindOfClass:[OneVC class]]) { OneVC *one = segue.destinationViewController; ... 阅读全文
posted @ 2016-05-10 17:52 小屁孩~ 阅读(189) 评论(0) 推荐(0)
摘要:上边是字体,下边是图片 阅读全文
posted @ 2016-05-05 17:56 小屁孩~ 阅读(371) 评论(0) 推荐(0)
摘要:button.imageEdgeInsets = UIEdgeInsetsMake(0, labelWidth, 0, -labelWidth);button.titleEdgeInsets = UIEdgeInsetsMake(0, -imageWith, 0, imageWith); 获取图片宽 阅读全文
posted @ 2016-05-05 17:53 小屁孩~ 阅读(441) 评论(0) 推荐(0)
摘要:@property (strong, nonnull) UIVisualEffectView *visualEffectView; -(void)setBackImageView { 阅读全文
posted @ 2016-05-05 14:45 小屁孩~ 阅读(266) 评论(0) 推荐(0)
摘要:转自http://blog.sina.com.cn/s/blog_74461f3201018b5x.html 阅读全文
posted @ 2016-04-27 14:27 小屁孩~ 阅读(1676) 评论(0) 推荐(0)
摘要:cookie清除 NSHTTPCookie *cookie; NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; for (cookie in [storage cookies]) { [stor 阅读全文
posted @ 2016-04-26 10:26 小屁孩~ 阅读(987) 评论(0) 推荐(0)
摘要:方法一:自定义视图的方法 就是在导航向上添加一个titleView,可以使用一个label,再设置label的背景颜色透明,字体什么的设置就很简单了。 方法二:在默认显示的标题中直接修改文件的大小和颜色也是可以的 阅读全文
posted @ 2016-04-25 14:48 小屁孩~ 阅读(2832) 评论(0) 推荐(0)