
OC
文章平均质量分 54
canlanyangg
这个作者很懒,什么都没留下…
展开
-
NSString copy string
property(nonatomic,copy)NSString *name;很简单,假如有一个NSMutableString,现在用他给一个retain修饰 NSString赋值,那么只是将NSString指向了NSMutableString所指向的位置,并对NSMUtbaleString计数器加一,此时,如果对NSMutableString进行修改,也会导致NSString的值修改,原原创 2016-12-22 15:38:28 · 276 阅读 · 0 评论 -
invalid bit code signature
Xcode8.3 编译时会遇到 如下图问题解决方式如下:1,Build Active Architecture Only: Debug = YES, Release = NOBitcode enabled = NO,2,清除缓存3,原创 2017-08-09 10:25:28 · 540 阅读 · 0 评论 -
ios 10.3 替换桌面图标
iOS 10.3 开放了更换 app 图标的 API,核心方法是下面这个:[[UIApplication sharedApplication] setAlternateIconName:@"blackBgColor" completionHandler:^(NSError * _Nullable error) { NSLog(@"set icon er原创 2017-08-10 10:25:10 · 1136 阅读 · 0 评论 -
webview js 注入
- (void)addSetPayPwdListener:(UIWebView *)webView{ NSArray *valueArray = [valueDictionary objectForKey:@"setPayPwd"]; NSString *pwdId1 = valueArray[0]; NSString *pwdId2 = valueArr原创 2017-09-06 17:12:34 · 231 阅读 · 0 评论 -
YLBTool.framework YLBKit.framework 使用规范
framework里有解析html的功能所以需要导入libxml2.tbdframework里有压缩解压缩的功能所以需要导入libz.1.tbdframework里有categroy所以在building-Other Linker Flages 设置 -ObjC原创 2017-09-26 16:51:25 · 192 阅读 · 0 评论 -
gcd 多线程
http://www.jianshu.com/p/324c2fded696转载 2017-09-27 15:29:52 · 201 阅读 · 0 评论 -
获取当前的UIViewController
+ (UIViewController *)getCurrentViewController { UIViewController *result = nil; UIWindow * window = [[UIApplication sharedApplication] keyWindow]; //app默认windowLevel是UIWindowLevelNorma原创 2017-11-01 10:32:41 · 459 阅读 · 0 评论 -
拼接头像组
1,根据图片url下载图片/** 根据网络图片,得到群组头像如果是网络图片,需要先把图片下载好。 @param URLArray 头像地址 @param bgColor 图片填充色 @return 群组头像 */+ (UIImage *)groupImageWithURLS:(NSArray *)URLArray backgroundColor:(UIC原创 2017-11-01 10:57:32 · 1003 阅读 · 0 评论 -
6位密码输入框
#import //_____________________________________________________________/@interface SSGridPwdTF : UITextField@end//_____________________________________________________________/原创 2018-04-24 11:57:03 · 1400 阅读 · 0 评论 -
apple store 评论
NSString *str = nil; if (@available(iOS 11.0, *)) { str = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/us/app/twitter/id%@?mt=8&action=write-review", AppStoreAppID]; } els原创 2018-05-09 11:30:22 · 484 阅读 · 0 评论 -
常用iOS URL Scheme附录 大全
转载自:https://blog.youkuaiyun.com/dkq972958298/article/details/52954195Safari: http://maps: http://maps.google.comPhone: tel:SMS: sms:Mail: mailto:iBooks: ibooks://App Store: http://itunes.apple.comiTunes: ht...转载 2018-06-05 15:51:12 · 23753 阅读 · 1 评论 -
开发技巧
https://juejin.im/entry/596330ae6fb9a06bc86e5ed6/转载 2018-07-04 10:18:35 · 180 阅读 · 0 评论 -
自定义字体
原创 2017-08-08 09:31:32 · 381 阅读 · 0 评论 -
tableview header footer 取消悬浮
CGFloat sectionHeaderHeight = 37; CGFloat sectionFooterHeight = 50; CGFloat offsetY = scrollView.contentOffset.y; if (offsetY >= 0 && offsetY { scrollView.contentInset =原创 2017-06-26 12:46:04 · 1437 阅读 · 0 评论 -
切换tabbar并返回栈顶 崩溃问题
ios8.2 以下代码会崩溃 [self.navigationController popViewControllerAnimated:YES];[((AppDelegate *)YLBApp).tabbar setSelectedIndex:selectedIndex];应改为 [self.navigationController popViewControllerA原创 2017-01-06 10:11:00 · 558 阅读 · 0 评论 -
@property和@synthesize用法
@property int count; 相当于在.h中定义(声明)了一个方法- (int)count; @synthesize count ;相当于在.m中实现了一个方法-(int)count{ return count;}原创 2017-01-10 16:12:49 · 260 阅读 · 0 评论 -
webView:decidePolicyForNavigationAction:request:frame:decisionListener
@implementation NSURLRequest (YLBIgnoreSSL)+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host{ return YES;}@end原创 2017-02-18 10:00:47 · 5608 阅读 · 0 评论 -
上传自己的代码到cocoapods
http://www.cocoachina.com/ios/20161027/17869.html步骤如下:代码上传Github创建podspec文件,并验证是否通过在Github上创建release版本注册CocoaPods账号上传代码到CocoaPods检查上传是否成功详细步骤如下:转载 2017-02-23 19:31:26 · 256 阅读 · 0 评论 -
可变数组 移除数据项
- (void)removeRoute:(NSString *)routePattern{ NSInteger routeIndex = NSNotFound; NSInteger index = 0; for (JLRRouteDefinition *route in [self.routes copy]) { if ([rout原创 2017-03-03 10:05:35 · 241 阅读 · 0 评论 -
jspatch
jspatch 不支持宏定义,枚举在block里调用self要先定义变量 var slf = self;原创 2017-02-24 12:28:48 · 269 阅读 · 0 评论 -
进入应用 提示飞行模式
info.plist 中加入一项 Application uses Wi-Fi,值为YES原创 2017-03-30 17:21:54 · 563 阅读 · 0 评论 -
runtime 对 viewcontroller属性赋值
-(void)paramToVc:(UIViewController *) v param:(NSDictionary *)parameters{ // runtime将参数传递至需要跳转的控制器 unsigned int outCount = 0; objc_property_t * properties = class_copyPropertyLis原创 2017-03-03 11:17:19 · 424 阅读 · 0 评论 -
webview 清除缓存
webview的缓存策略,其实就是 NSURLRequest的缓存策略,有以下几种NSURLRequestUseProtocolCachePolicy //默认值 有缓存,如果网络失败则取缓存数据NSURLRequestReloadIgnoringLocalCacheData //忽略缓存数据NSURLRequestReturnCacheDat原创 2017-04-01 14:19:26 · 472 阅读 · 0 评论 -
NSNotificationCenter 移除监听
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loadDdataConnect) name:kloginSuccess object:nil];[[NSNotificationCenter defaultCenter] removeObserver:self];原创 2017-02-21 15:49:32 · 1032 阅读 · 0 评论 -
automaticallyAdjustsScrollViewInsets
automaticallyAdjustsScrollViewInsets = YES 根据所在界面的status bar,navigationbar,与tabbar的高度,自动调整scrollview的 inset设置为no,不让viewController调整,我们自己修改布局即可原创 2017-07-11 17:19:48 · 981 阅读 · 0 评论 -
tableview header 取消 悬浮
CGFloat sectionHeaderHeight = 40; if (scrollView.contentOffset.y=0) { scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0); } else if (scrollView.content原创 2017-06-26 12:43:27 · 509 阅读 · 0 评论 -
crc16
//// NSData+CRC16.h// CRC16_iOS//// Created by Echo on 16/3/21.// Copyright © 2016年 Liu Xuanyi. All rights reserved.//#import <Foundation/Foundation.h>@interface NSData (CRC16)//...原创 2018-12-03 15:29:10 · 248 阅读 · 0 评论