
iOS
Rex_Code
技术菜,又懒惰、不上进
展开
-
FMDB数据库损坏 database disk image is malformed, code:11
FMDB数据库损坏 database disk image is malformed, code:11使用FMDB数据库的时候,有时会遇到 数据库损坏的问题,FMDB又没有提供修复工具,导致App数据库无法打开,只能删除数据库,这样不是很友好。解决方法是 ,使用 WCDB(微信的数据库) 替换,作为数据库工具,WCDB 提供修复功能,能解决 SQLite 错误码 11、26的问题。如果之前是用FMDB,也可以同时引入 WCDB,然后用WCDB 来备份,发生错误的时候,就可以用WCDB来修复。..原创 2022-02-25 20:46:22 · 1083 阅读 · 0 评论 -
M1 Mac安装cocoapods
问题1:终端安装CocoaPods时失败报错解决办法:在“应用程序”中找到“终端”,右键打开终端选择”显示简介”在“显示简介”中勾选“使用Rosetta方式打开”运行sudo gem install cocoapods(之前安装过就略过)运行sudo gem install ffi最后pod install问题2:终端使用’pod install’指令时报错解决办法:在终端输入如下指令sudo arch -x86_64 gem install ffi arch -x转载 2022-02-21 16:23:43 · 1017 阅读 · 0 评论 -
tableView 不走 didSelectRowAt 代理方法
tableView 不走 didSelectRowAt 代理方法今天同事写了个tableView,结果点击不走代理方法 didSelectRowAt检查了一遍,tableView frame 没问题,没有手势拦截,cell 上面也没有其他控件拦截。最后发现问题在这tableView.allowsSelection = true主要是他用 xib 拉的控件,找了半天也没发现,最后还是各种搜索才解决了。...原创 2021-11-22 16:44:04 · 1535 阅读 · 0 评论 -
iOS tabbar颜色适配
// 设置标题颜色 let normal_attr = [NSAttributedString.Key.foregroundColor: UIColorFormRGB(rgbValue: 0x202020)] let select_attr = [NSAttributedString.Key.foregroundColor: normalRedColor] if #available(iOS 13.0, *) { let...原创 2021-07-23 12:07:58 · 351 阅读 · 0 评论 -
The certificate used to sign “XXX“ has either expired or has been revoked.
The certificate used to sign “XXX” has either expired or has been revoked. An updated certificate is required to sign and install the application.乍一看,不就是证书过期或被撤销了,然后想着重新搞下证书就好。然后搞了一下,发现不行,一运行还是报同样的错误。于是无奈Google一番,得到的答案基本也是重新搞证书。搞了一个小时,怎么试都不行。后来看到手机的一个ap原创 2021-07-17 10:15:12 · 794 阅读 · 4 评论 -
iOS WKWebView 点击图片放大
iOS WKWebView 点击图片放大func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { /// 禁止缩放 let injectionJSString = """ var script = document.createElement('meta');\ script.name = 'viewport';\原创 2021-06-09 11:12:25 · 1193 阅读 · 0 评论 -
M1 Mac 安装 cocoapods
基于开启VPN1.sudo gem install cocoapods -n /usr/local/bin sudo gem install ffipod setup参考原创 2021-05-13 22:49:03 · 489 阅读 · 0 评论 -
M1 Mac YYKit 报错
ld: in /Users/xxxxxx/Desktop/xxxxxx/xxxxxx/Pods/YYKit/Vendor/WebP.framework/WebP(libwebpencode_la-config.o), building for iOS Simulator, but linking in object file built for iOS, for architecture arm64解决方法:加上 arm64 即可参考原创 2021-05-13 22:28:05 · 3517 阅读 · 0 评论 -
卡住在 Cloning spec repo ‘cocoapods‘ from ‘https://github.com/CocoaPods/Specs.git‘
卡住在 Cloning spec repo ‘cocoapods’ from ‘https://github.com/CocoaPods/Specs.git’解决:去官网手动下载 https://github.com/CocoaPods/Specs然后解压 放到 ~/.cocoapods/repos/cocoapods记得要把 .git 文件夹 放到 cocoapods 目录下...原创 2021-05-10 16:22:22 · 5427 阅读 · 0 评论 -
iOS文字间距对齐
用的是比较笨的办法,通过设置文字间距来实现,直接来代码/// 创建订单选项视图 /// - Parameters: /// - itemName: 选项名称,如:手机号 下单时间 /// - contentStr: 选项对应的具体值 /// - count: 选项名称的文字个数,如 手机号有3个文字,下单时间有4个文字 /// - Returns: 创建好的视图 func createOrderItemInfoView(itemName: St.原创 2021-04-16 11:53:25 · 372 阅读 · 0 评论 -
iOS 检测 UIWebView引用
自从2020开始,苹果不再允许使用 UIWebView,检测项目中引用 UIWebView1.打开终端,cd 到项目的工程文件所在的路径2.输入以下命令,注意最后有个 . 点号grep -r UIWebView .3.以上操作都正确的话,会马上出现工程中带有 UIWebView 的文件的列表(包括在工程中无法搜索到的 .a 文件中对UIWebView 的引用)注:引用AFNetWorking可以直接把AFNetWorking 里面的 UIWebView+AFNetworking 扩展删掉就可以原创 2021-01-29 10:11:53 · 400 阅读 · 0 评论 -
iOS 延迟搜索 实时搜索
在实现搜索功能的时候,搜索框的值发生变化,我们不可能每次都去调用接口,应该等用户结束输入的时候再去调用接口搜索,记录搜索框的值发生变化的间隔,可以比较有效的监听用户的输入状态。/// 上一个输入的时间,避免每次输入都调用搜索接口@property (nonatomic, assign) __block NSTimeInterval preInputTime;#pragma mark - 搜索相关- (void)textFieldValueDidChange:(UITextField *)textF原创 2021-01-22 16:17:29 · 707 阅读 · 0 评论 -
iOS 拨打电话
第一种NSString *phoneStr = [NSString stringWithFormat:@"tel://%@",phone];if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0) { //设备系统为IOS 10.0或者以上的 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneStr] options:@原创 2020-12-23 11:40:15 · 1307 阅读 · 0 评论 -
PCH文件引入pod头文件报错
今天接手了一个项目,是比较旧的,第三方库都是直接手动拖进来的,没有使用cocoapods,我使用cocoapods增加了一些三方库,把头文件写到PCH文件的时候,报错,说找不到对应的文件。路径那些是没有问题的可以试下 这样来解决:#ifdef OBJC#import <YYKit.h>#endif或者#ifdef __OBJC__#import <YYKit.h>#endif...原创 2020-12-08 08:54:22 · 541 阅读 · 0 评论 -
Mac 隔空投送 AirDrop 搜不到 iPhone
最近在使用 隔空投送 AirDrop 的时候,遇到 iPhone 能搜到 Mac,但是 Mac 搜不到 iPhone 的情况,可以试下下面的方法来解决:把iPhone设置成飞行模式,然后再关闭飞行模式,Mac 就能搜到iPhone。Mac 的 iCloud 账号 退出登录,iPhone 的 iCloud 账号 退出登录,然后重启Mac 和 iPhone,最后重新登录 Mac 和 iPhone 的 iCloud 账号 ,就能解决。...原创 2020-10-12 10:48:17 · 8815 阅读 · 0 评论 -
iPhone 隐藏了App 如何恢复
iPhone 的某个App 设置了隐藏,想要恢复,却找不到方法,网上搜了一堆,没有一个有用。笔者这里也不知道如何恢复,最后搞了半天,只能曲线救国了:先把App 删除了,再重新下载,就能把App图标搞出来了。步骤:设置—》通用—》iPhone存储空间—》优酷(找到对应的App)—》点击去,删除或者卸载,最后重新去App Store下载安装,就可恢复。具体步骤如图:...原创 2020-09-23 21:57:21 · 27052 阅读 · 0 评论 -
Mac 最新安装 HomeBrew
/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"卡住在==> Tapping homebrew/coreCloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...终端安装,运行这个git clone git://mirrors.ustc.edu.cn/homebrew-原创 2020-08-19 09:08:00 · 200 阅读 · 0 评论 -
Protocol Buffers 在iOS的使用
Protocol Buffers 简单的说是对结构化的数据进行序列化(Json格式、XML格式)的一种语言,但是更小、更快、更简单,更多的用于IM即时通讯这一块,有助于节省流量,提高性能。Protocol Buffers 是谷歌的,官网连接现在我们来简单的体验下 Protocol Buffers 在 iOS 的使用。安装使用环境,打开终端安装 homebrew通过 homebrew 安装其他需要的工具brew install automakebrew install libtoolbrew原创 2020-08-12 16:02:28 · 799 阅读 · 0 评论 -
16进制颜色转换RGB原理
常见的几种表示颜色的方法有:ColorName: 直接用颜色的名称来指定颜色,比如: red blue green yellow优点: 很直观的表达想要使用的颜色缺点: 颜色的名称很少, 不能有效表示一些较为丰富的颜色RGB: 三通道颜色他是目前运用最广泛的颜色系统之一可以通过红绿蓝三色通道, 外加alpha透明度, 来展示几乎所有的颜色RGB是从颜色的发光原理来设定的, 相当于红绿蓝三个颜色通过不同亮度, 来组合成为需要的颜色0为最暗, 255为最亮HEX: 十六进制原创 2020-07-08 14:39:22 · 8939 阅读 · 0 评论 -
ERROR ITMS-90725: “SDK Version Issue.
ERROR ITMS-90725: "SDK Version Issue.ERROR ITMS-90725: "SDK Version Issue. This app was built with the iOS 12.1 SDK. As of June 30, 2020, all apps for iPhone or iPad must be built with the iOS 13 SDK or later, included with Xcode 11 or later."今天在打包上传到App原创 2020-07-07 17:52:35 · 6306 阅读 · 8 评论 -
iOS 按钮 Button 高亮不变灰
iOS button 点击高亮的时候不变灰, 把按钮类型改为自定义即可 _continueBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [_continueBtn setBackgroundImage:[UIImage imageNamed:@"mhsq_history_continue"] forState:UICont...原创 2019-11-28 10:51:24 · 1273 阅读 · 0 评论 -
IM聊天会话列表,时间简单判断
IM聊天会话列表,时间简单判断//时间显示内容-(NSString *)getDateDisplayString:(long long) miliSeconds{NSLog(@"-时间戳---%lld_----",miliSeconds);NSTimeInterval tempMilli = miliSeconds;NSTimeInterval seconds = tempMilli/...原创 2019-11-06 15:58:11 · 2824 阅读 · 0 评论 -
ios tableView的约束警告,NSLayoutConstraint:.width == 0
Unable to simultaneously satisfy constraints.Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out whic...原创 2019-10-14 16:52:33 · 1505 阅读 · 0 评论 -
ERROR ITMS-90174: "Missing Provisioning Profile - Apps must contain a provisioning profile in a file
ERROR ITMS-90174: “Missing Provisioning Profile - Apps must contain a provisioning profile in a file named embedded.mobileprovision.”出现这个问题,主要是在打包的时候 Provisioning 文件没有选中,在打包选择证书的时候选中对应 provisioning ...原创 2019-03-07 20:11:45 · 1390 阅读 · 0 评论 -
iOS IPA上传被拒,info.plist缺少定位权限描述
Dear Developer,We identified one or more issues with a recent delivery for your app,“XXXX”. Please correct the following issues, then upload again.“Missing Purpose String in Info.plist File. Your ...原创 2019-03-29 18:02:11 · 6042 阅读 · 5 评论 -
微信授权登录 界面 “确认登录”无响应
微信授权登录 界面 “确认登录”无响应在调起微信授权登录界面时,点击 “确认登录”没有反应,可能是 scheme appid 没有配置正确原创 2019-04-08 10:48:47 · 9616 阅读 · 0 评论 -
iOS tableView 拉不到底 动态计算头部高度
iOS tableView 拉不到底原因可能有:tableView 的frame 不对,这会导致 tableView 不能滑到最后一条,显示不完全tableView的 tableHeaderView、tableFooterView 的高度设置不正确导致的解决方法:对于第一个问题,把frame计算正确即可第二个原因造成的问题,则要正确计算 tableHeaderView、tableF...原创 2019-04-23 11:33:55 · 687 阅读 · 0 评论 -
authenticating with the app store 一直卡住
authenticating with the app store 一直卡住最近更新App,要上传到 App Store 的时候,一直卡在 Authenticating with the App Store ,有人说 打开终端执行以下命令即可,试了,但是并没有生效cd ~mv .itmstransporter/ .old_itmstransporter/"/Applications/Xc...原创 2019-05-09 10:09:13 · 7741 阅读 · 0 评论 -
iOS 审核权限描述不够明确被拒
这么简单明了的告诉你要用相机来扫描二维码,苹果的人竟然还说不够明确,什么鬼!!!忍不住吐槽一下!!!原创 2019-05-11 14:22:05 · 2223 阅读 · 2 评论 -
iOS 审核解决中心-附件-无法载入文件
iOS 审核被拒的时候,在审核解决中心添加附件的时候,提示 无法载入文件 ,造成这个原因主要是上传的附件名称中包含了中文,所以重命名一下附件,不要带有中文就好,最好也不要搞特殊符号。...原创 2019-06-11 16:40:14 · 2984 阅读 · 0 评论 -
The iOS deployment target is set to 6.0, but the range of supported is 8.0 to 12.0
The iOS deployment target is set to 6.0, but the range of supported deployment target versions for this platform is 8.0 to 12.0.(in target ‘Masonry’)xcode 第三方框架黄色警告:消除警告:把对应的第三方框架的deployment targ...原创 2018-10-05 18:19:02 · 8858 阅读 · 0 评论 -
Carthage管理依赖库
1.安装carthage 首先是安装brew,终端命令: curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local –strip 1 升级brew brew update 然后开始安装carthage brew install carthage2.使用转载 2017-05-26 10:38:25 · 805 阅读 · 0 评论 -
xcode has denied the launch request
iPhone has denied the launch request.之前App 打包都是 人工打,公司小,项目小,懒得搞脚本后来换工作了,公司的电脑垃圾的一逼,一打包就死机,所以只好重新搞脚本打包。然后发现打包完后,重新运行App,出现了 has denied the launch request.还真是第一次遇到,各种找原因,基本都是说证书乱了,重新更新证书就好,但我的证书是好...原创 2019-03-19 17:15:33 · 617 阅读 · 2 评论 -
no suitable image found. Did find:
不知道为什么会出现这个情况,希望知道的能说一下在终端 运行下面的命令 就可以解决问题rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"rm -rf ~/Library/Developer/Xcode/DerivedDatarm -rf ~/Library/Caches/com.apple.dt.Xcode...翻译 2019-02-13 19:43:07 · 10037 阅读 · 1 评论 -
Unable to copy symbols from this device
Xcode 真机调试的时候会出现各种问题(这里说的不包括证书问题),有很多是缓存造成的问题,基本上只要删除缓存,就能解决,如图所示:/Users/当前电脑用户名/Library/Developer/Xcode/DerivedData删除对应APP 的文件夹即可,全部删了也可以...原创 2019-02-13 09:20:18 · 2907 阅读 · 0 评论 -
ios 自定义返回按钮,导航栏黑色分割线
iOS 自定义navigationBar 的返回按钮,在开发的时候,系统自带的返回按钮样式往往 不能满足设计需求,但是我们又不想自定义导航栏,其实返回按钮的样式是可以修改的,看下官方的解释: 基本能明白:要自定义返回按钮的返回图片,就必须同时实现红色框内的两个方法代码: // 导航栏返回按钮 图片 [UINavigationBar appearance].backIndicat原创 2017-07-14 11:11:47 · 2067 阅读 · 0 评论 -
Your account already has a signing certificate for this machine but it is not present in your keycha
Your account already has a signing certificate for this machine but it is not present in your keychain. To create a new one, you must first revoke the existing certificate. xcode证书管理出现这个错误解决方法:简单点的直接按照原创 2017-06-12 16:55:20 · 6765 阅读 · 0 评论 -
iOS应用内语言切换功能
原文链接当我们的应用仅仅面向国内用户群,一般仅支持一种语言–中文就可以了。当面向国外用户时就需要进行国际化了,不仅仅是语言的转变,也可能包括设计风格,页面布局、交互效果的转变,如微信,微博,QQ这类应用都有着切换语言的功能。iOS确定应用的语言1.iOS首先搜索用户的语言偏好设置(设置-通用-语言与地区) 2.检测你的应用是否支持用户的语言,先用偏好设置的第一个语言,检测应用是否包含该语言对应的文转载 2017-06-20 15:28:11 · 747 阅读 · 0 评论 -
ios多语言、国际化
原文链接将文本国际化常用的3个方面一一讲解根据系统语言设置,应用名称的多语言切换 根据系统语言设置,应用内容的多语言切换 在应用内,手动切换多语言 优化 初体验多语言–APP应用图标的多语言效果:Uploading 屏幕快照 2016-11-17 上午9.10.00_240252.png …] 在设置——通用——语言 中选择日语屏幕快照 2016-11-17 上午9.10.00.png转载 2017-06-20 14:51:19 · 493 阅读 · 0 评论 -
ios 导航控制器UInavigationController跳转以及返回传值
(1)使用NavigationViewController进行页面跳转时,应该使用pushViewController方法来跳转至下一页面,这样的话,下一页面同样在NavigationViewController容器中。1、跳转到下一页面: PowerViewController *power = [[PowerViewController alloc] init];//所要跳转页面Powe转载 2017-05-22 20:40:34 · 1120 阅读 · 0 评论