自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(170)
  • 资源 (2)
  • 收藏
  • 关注

原创 dyld: Library not loaded: @rpath/libswiftCore.dylib问题解决

'/usr/lib/libswiftCore.dylib' (no such file)

2023-02-20 16:19:19 528

原创 tableview默认选中第一行

//默认选中第一行,并执行点击事件 NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; [mytableview selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:YES scrollPosition:UITableViewScrollPositionTop]; if ([mytableview.de...

2021-12-27 19:49:37 842

原创 HomeBrew正确安装姿势

镜像安装脚步:/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"

2021-11-15 16:59:06 323

原创 UITextView修改光标位置

let feedbackTV = UITextView() var orgContainerInset = feedbackTV.textContainerInset orgContainerInset.left = 5; feedbackTV.textContainerInset = orgContainerInset

2021-09-23 10:47:21 711

原创 安装HomeBrew curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubuserconten

使用国内源/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

2021-09-22 16:32:20 369

原创 在Xcode编译的时候,报这个错误"library not found for -

分析原因,解决问题:在Xcode编译的时候,可能会遇到报这个错误"library not found for - ",这是为什么呢?由于我们在项目中使用了一些第三方的库,如百度的静态库。当Xcode在编译的时候却找不到这个库,所以我们要让Xcode知道这个库文件在哪里,这样在编译的时候就可以轻松的找到库了。解决方法:获取 库文件所在的文件路径 ,添加到Target的Build Settings界面,如图:若上述方法还未能解决,以下共有3种方法方法一:点击 XCode 工程文件,在.

2021-08-19 16:37:59 2130

原创 NSMutableArray 为什么不能用copy修饰

官方文档解释:__NSFrozenArrayM - an immutable NSArray sharing its storage with an NSMutableArray that it was -copy’d from (will do a real copy if the original array is mutated)“从 NSMutableArray 的 copy 函数返回的 NSArrayI,暂时与原数组共用一段内存,若原数组变化则再真正复制一次”。这是熟悉的 copy-on

2020-10-26 11:37:59 267

原创 UIView 被移除添加的监听方法

- 当视图添加子视图时调用- (void)didAddSubview:(UIView *)subview;- 当子视图从本视图移除时调用- (void)willRemoveSubview:(UIView *)subview;- 当视图即将加入父视图时 / 当视图即将从父视图移除时调用- (void)willMoveToSuperview:(nullable UIView *)newSuperview;- 当视图加入父视图时 / 当视图从父视图移除时调用- (void)didMov...

2020-09-29 16:45:05 1087

原创 iOS KVO 监听数组变化

首先,数组不能直接使用KVO使用监听。当我们想要使用KVO监听数组,我们需要进行一下几步。1.KVO不能监听UIViewController中的数组。我们需要先创建一个模型,将数组添加值模型中。@interface SelectedsArr : NSObject@property (nonatomic, strong) NSMutableArray *selecteds;///<选中的选项集合@end2.建立观察者以及观察者对象[self.selectedsArr addObser

2020-09-07 10:45:01 1161

原创 early EOF fatal: index-pack failed

First, turn off compression:git config --global core.compression 0Next, let's do a partial clone to truncate the amount of info coming down:git clone --depth 1 repo_URIWhen that works, go into the new directory and retrieve the rest of the clone:git

2020-05-09 12:09:31 478

原创 ios首行缩进

NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init]; paragraphStyle.firstLineHeadIndent = 15; // 首行缩进 paragraphStyle.alignment = NSTextAlignmentJustified;...

2019-12-02 17:43:43 473

原创 UIScrollView自适应高度

UIScrollView *scrollView = [[UIScrollView alloc]init]; scrollView.showsHorizontalScrollIndicator=NO; scrollView.showsVerticalScrollIndicator = NO; [self addSubview:scrollView]; [scro...

2019-11-14 16:04:59 2236

原创 .gitignore忽略文件无效的解决办法

.gitignore中已经标明忽略的文件目录下的文件,git push的时候还会出现在push的目录中,原因是因为在git忽略目录中,新建的文件在git中会有缓存,如果某些文件已经被纳入了版本管理中,就算是在.gitignore中已经声明了忽略路径也是不起作用的,这时候我们就应该先把本地缓存删除,然后再进行git的push,这样就不会出现忽略的文件了。git清除本地缓存命令如下:git rm ...

2019-08-15 13:12:50 287

原创 [UITabBar appearance]不生效

原因:appearance必须要在添加控件之前设置,控件渲染以后才设置appearance那么无效解决方式:把控件重新重界面中删除,然后在重新添加

2019-08-14 18:03:50 760

原创 ios导航栏移除栈中某一个控制器

NSMutableArray *vcArr = [[NSMutableArray alloc]initWithArray:self.navigationController.viewControllers]; for (UIViewController *vc in vcArr) { if ([vc isKindOfClass:[someone class...

2019-08-09 13:48:02 2187

原创 RAC几个常用的方法

///KVO [[self.header rac_valuesForKeyPath:@"" observer:self]subscribeNext:^(id _Nullable x) { } completed:^{ }]; ///通知中心 [[[NSNotificationCenter defaultCenter]r...

2019-05-20 10:45:44 334

原创 UITabBar修改顶部线条颜色

CGRect rect = CGRectMake(0.0f, 0.0f, self.view.bounds.size.width, 0.5); UIGraphicsBeginImageContextWithOptions(rect.size,NO, 0); CGContextRef context =UIGraphicsGetCurrentContext(); CGCon...

2019-04-30 11:47:14 700 1

原创 iOS拦截crash异常

NSSetUncaughtExceptionHandler(handle);void handle(NSException *exception){ NSLog(@"崩溃的原因是%@",exception.reason); NSLog(@"崩溃的名称是%@",exception.name); NSLog(@"崩溃的堆栈信息是%@",exception.call...

2019-04-18 10:26:42 736

原创 iOS手势返回的取消与开启

- (void)viewDidAppear:(BOOL)animated{ [super viewDidAppear:animated]; // 禁用返回手势 if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { se...

2019-04-16 15:55:50 1394

原创 iOS监听键盘的起落

// 添加通知监听见键盘弹出/退出 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardAction:) name:UIKeyboardWillShowNotification object:nil]; [[NSNotificationCenter defaultCent...

2019-04-10 16:01:56 788

原创 mac os 统计代码行数

安装Homebrew/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"卸载brewruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/un...

2019-04-09 14:31:48 550

原创 多层block引用释放问题

- (void)setUpModel{ XXModel *model = [XXModel new]; __weak typeof(self) weakSelf = self; model.dodoBlock = ^(NSString *title) { __strong typeof(self) strongSelf = weakSelf;//...

2019-03-28 16:10:20 284

原创 ios控制器viewdidload注册通知,未显示页面无法响应通知

在init方法里直接注册通知,这样在tabbar控制器创建的时候就开始监听了

2019-03-20 19:30:35 420

原创 swift4.0 setValuesForKeys方法崩溃解决办法

在swift3中,编译器自动推断@objc,换句话说,它自动添加@objc在swift4中,编译器不再自动推断,你必须显式添加@objc解决办法: // MARK:- 定义属性 @objc var tag_name : String = "" @objc var icon_url : String = ""...

2019-02-15 11:45:06 625 1

原创 价格保留非0位数

 NSString * str = @"0.1020";    NSDecimalNumber * result = [NSDecimalNumber decimalNumberWithString:str];    NSLog(@"价格%@",result);

2019-02-08 14:06:31 162

原创 NSObjCRuntime, NSZone, NSObject 报错

Xcode 导入cpp文件和C文件之后foundtion框架的三个文件报错分别是NSObjcRuntimeNSObjectNSZone意思是说 oc 与 c 混编的时候,由于 prefix 文件没有区分是否是 oc 文件,对 C 文件也import了 OC 的framework。解决方案就是 在 prefix 文件之中 的 oc framework 添加#ifdef __OBJC_...

2019-01-15 17:34:29 351 1

原创 父视图响应自视图事件

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {    CGPoint newP = [self convertPoint:point toView:self.statuTF];    if ( [self.statuTF pointInside:newP withEvent:event]) {        re...

2019-01-09 14:25:51 193

原创 iOS push界面下移64高度

push界面下移64高度的解决办法:self.extendedLayoutIncludesOpaqueBars = YES; 

2019-01-08 15:56:36 1063

原创 ios 页面向导航栏内嵌的时候需要把导航栏的穿透效果关闭

 self.navigationController.navigationBar.translucent = NO;

2018-12-24 17:46:07 1140

原创 CGContextStrokePath(context) 处崩溃,EXC_BAD_ACCESS

在绘制之前,要加一句 UIGraphicsBeginPDFPage();

2018-10-09 18:00:59 406

转载 Xcode10 library not found for -lstdc++ 找不到问题

在Xcode9上正常编译的项目,在Xcode10上编译可能会遇到如下错误:library not found for -lstdc++.6.0.9library not found for -lstdc++.6library not found for -lstdc++这是因为Xcode10彻底废弃了libstdc++,相关的库文件libstdc++.6.0.9.dylib、libs...

2018-09-19 11:23:55 1439

原创 Error Domain=NSURLErrorDomain Code=-999 请求取消

1、错误一:Error Domain=NSURLErrorDomain Code=-999导致原因:1、一个页面没有被完全加载之前收到下一个请求,此时迅速会出现此error,error=-9992、此时可能已经加载完成,则忽略此error,继续进行加载。2、错误二 :AFNetworking进行证书认证时出错,取消请求导致原因:在AFSecurityPolicy.m文件中执...

2018-09-05 11:30:02 25875

原创 服务端后台返回数据为Null的容错处理

有时候后台返回数据为null值的时候,我们客户端拿来用就会发生访问不到对象本该有的方法而crash 在此,我们判断其类型是否为NSNull来进行容错处理 如下:  if (![info[@"roomOwnNo"] isKindOfClass: [NSNull class]]){                self.chanquanNumber =info[@"roomOwnNo"] ;...

2018-08-31 18:19:24 2585

原创 Your app uses or references the following non-public APIs的解决方案

Your app uses or references the following non-public APIs:setTimeOut:The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs c...

2018-08-29 10:19:16 267

原创 数据库报错 DB Error: 1 "unrecognized token: ":"" 的解决方法

做iOS开发,今天写数据库,遇到了这个错误。我的数据库中有个字段也是token。刚开始以为是这个字段出了什么问题,不过后来排查,发现跟这个字段完全没有关系。这个就是sqlite3里的。 NSString *sql_select = [NSString stringWithFormat:@"select * from %@ where uid = %@ and dev_id = %@",...

2018-08-23 11:00:26 18100

原创 mac os如何恢复网络出厂设置

有时候电脑添加VPN或者DNS配置错误会发生部分网站访问不了或者App Store无法访问的现象,这个时候我们需要恢复Mac的网络出厂设置1.点击Finder -&gt;go-&gt;computer2.选择Macintosh hd3.选择library,中文系统里是资源库4.找到preferences文件夹5.打开systemconfiguration这个文件...

2018-08-13 17:42:14 65046 9

原创 更新cocoapods后出现“ unrecognized selector sent to class xxx”错误

出现 “ unrecognized selector sent to class xxx” 这个错误之后,以为是调用没有实现的方法,但是查看之后不是的,这个是调用的三方库中的方法,不可能没有实现。然后上网搜索相关内容,几乎所有的修复办法都是:  Target-&gt;Buid   Settings-&gt;Linking   下   Other   Linker  Flags   项添加-ObjC...

2018-08-13 14:48:58 560

原创 Limit分页查询性能优化

  1.语法:      *** limit [offset,] rows      一般是用于select语句中用以从结果集中拿出特定的一部分数据。      offset是偏移量,表示我们现在需要的数据是跳过多少行数据之后的,可以忽略;rows表示我们现在要拿多少行数据。      2.栗子:      ①select * from mytbl limit 10000,10...

2018-07-30 09:45:53 2380 3

原创 ios 访问相机权限弹框的点击方法获取

   NSString *mediaType = AVMediaTypeVideo;//读取媒体类型    AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];//读取设备授权状态    [AVCaptureDevice requestAccessForMe...

2018-07-26 11:18:08 6292

原创 dyld: Library not loaded: @rpath/CustomSDK.framework/CustomSDK 错误解决

dyld: Library not loaded: @rpath/MySDK.framework/MySDK  Referenced from: /var/mobile/Applications/08B6D2C2-5028-4A64-93F5-1252B0B0BCAB/MyApp.app/MyApp  Reason: no suitable image found.  Did find:...

2018-07-25 12:31:04 4576

YWXCustomTextView.zip

自定义TextView 限制输入长度

2022-01-10

Smallflower

养花管理

2016-10-22

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除