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

浙公网安备 33010602011771号