
iOS开发 --- 随笔篇
带我逃跑吧
一个在天津/上海的安徽iOS开发,请多指教
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
iOS开发之上传pdf格式文件
- (void)presentDocumentPicker { NSArray *types = @[@"com.adobe.pdf"]; // 可以选择的文件类型,下面有关于type的解释 UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWit...原创 2020-01-15 13:07:46 · 2825 阅读 · 0 评论 -
iOS开发之使用FSCalendar日历选择
FSCalendar日历选择器,需求说明:1.需自定义日历顶部,左右小按钮可点击切换月份2.当天文字颜色为主色调,选中为含有背景色3.日历样式只显示当月时间4.周六、周日文字与其他日期颜色不同5.点击已过去的时间不可创建先上界面//// XYCalendarTableViewCell.h//// Created by daiwotaopaoba@icloud.com...原创 2020-01-14 11:22:34 · 5438 阅读 · 0 评论 -
iOS开发之录制小视频
调用- (void)setupConfigWithVideo {NSString *unUserInfo = nil;if (TARGET_IPHONE_SIMULATOR) { unUserInfo = @"您的设备不支持此功能";}AVAuthorizationStatus videoAuthStatus = [AVCaptureDevice authorizationSt...原创 2018-09-13 11:36:00 · 1716 阅读 · 2 评论 -
iOS开发之随意移动的按钮,固定x轴根据y轴移动
我封装一个可移动的view,点击后文字出现,原创 2018-07-04 09:56:20 · 1078 阅读 · 0 评论 -
iOS开发之"Request failed: unsupported media type (415)" UserInfo={NSLocalizedDescription=Request failed
AFNetworking POST 提示:"Request failed: unsupported media type (415)" UserInfo={NSLocalizedDescription=Request failed: unsupported media type (415),如果你设置了这些参数还是报错的话 AFHTTPSessionManager *manager = [A...原创 2018-07-10 09:55:50 · 6173 阅读 · 0 评论 -
iOS开发之使用P3图片导致崩溃的解决方法
最近app刚上架,突然收到大面积投诉....一看bugly,9.0-9.3的机器无一幸免,由于项目里有些图标是我直接从阿里图库下载的,问了UI P3,16进制的图片是什么他也说不清,索性让他重新做图了,这个问题只要图片是UI做图基本就可避免1.打包成ipa2.把ipa的后缀改成zip,解压缩(这时候会看到一个Payload文件夹)3.打开终端 输入 cd 4.把 Payload 拖动到终端里...原创 2018-05-24 17:46:46 · 1375 阅读 · 1 评论 -
iOS开发之错误集锦之cocoapods
1.cocoapods was not able to update the 'master' repo.if it is a unexpected issue and persists you can inspect it running 'pod repo update --verbose pod repo update --verbose2.[!] /usr/bin/git clone ht...原创 2018-04-04 14:17:08 · 230 阅读 · 0 评论 -
iOS开发之Xcode11.3运行提示Could not locate device support files. This iPhone 5s (Model A1457, A1518, A1528,
Could not locate device support files.This iPhone 5s (Model A1457, A1518, A1528, A1530) is running iOS 11.3 (15E216), which may not be supported by this version of Xcode.Could not locate device suppor...原创 2018-04-04 11:01:23 · 3037 阅读 · 1 评论 -
ERROR ITMS-90717: "Invalid App Store Icon. The App Store Icon in the asset catalog in ‘***.app' can'
在提交到apptore时提示:ERROR ITMS-90717: "Invalid App Store Icon. The App Store Icon in the asset catalog in ‘***.app' can'实际因为AppIcon里有一张1024x1024的图片含有透明度了.如果没有UI的话只能我们自己处理,先转化成jpeg,再有jpeg转化成png再打包提交就ok了...原创 2018-04-03 10:37:56 · 2889 阅读 · 0 评论 -
Hi
希望大家可以共同进步,共勉原创 2018-09-26 09:57:14 · 410 阅读 · 0 评论 -
iOS开发之设置statusbar失效等问题
在app里我们经常会遇到有的界面状态栏需要是白色,有的需要是黑色的情况。问题1.info.plist设置了但是vc里修改不掉颜色应在info.plist加上这么一句,该意思为vc设置的优先级高于info.plist的设置View controller-based status bar appearance Bool YES问题2.preferredStatusBarStyle无法修改...原创 2019-03-08 14:48:20 · 1053 阅读 · 0 评论 -
iOS开发之对iOS11安全区域对探索以及解决适配问题
iOS9 Storyboard引用了一个新的安全区域UILayoutGuide的概念,假设我们需要使用storyboard,并且同时向下适配iOS8,隐藏navigationbar的vc该怎么处理没有间距呢?1.storyboard向下适配iOS8,首先要去掉勾选的Use Safe Area Layout Guides,如图所示2.代码隐藏navigationbar- (void)vie...原创 2019-03-06 17:05:50 · 850 阅读 · 0 评论 -
iOS开发之根据宽度计算文字高度
- (CGFloat)calculateRowHeight:(NSString *)string fontSize:(NSInteger)fontSize width:(CGFloat)width{ NSDictionary *dic = @{NSFontAttributeName:[UIFont systemFontOfSize:fontSize]}; CGRec...原创 2019-03-13 17:57:26 · 1328 阅读 · 0 评论 -
iOS开发之UITableView+FDTemplateLayoutCell.h崩溃问题以及mjrefresh无法下拉刷新或刷新偏移问题
1.<UITableView+FDTemplateLayoutCell.h>在iOS10上使用时会崩溃,崩溃时提示to uncaught exception ‘NSInternalInconsistencyException’, reason: 'Cell must be registered to table view for identifier - CircleCommentTa...原创 2019-03-30 16:48:38 · 700 阅读 · 0 评论 -
iOS开发之IQKeyboardManager失效与UITableViewController
问题:在UITableViewController里使用IQKeyboardManager点击textfield键盘不上移。法1.- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [[IQKeyboardManager sharedManager] setEnable:YES];...原创 2019-05-05 10:46:58 · 2331 阅读 · 0 评论 -
iOS开发之处理网络请求返回的null、<null>等
新建一个NSDictionary分类#import <Foundation/Foundation.h>@interface NSDictionary (Null)+ (id)changeType:(id)myObj;@end#import "NSDictionary+Null.h"@implementation NSDictionary (Null)+ (i...原创 2019-05-09 17:40:25 · 556 阅读 · 0 评论 -
iOS开发之简述底部tabbar上某一vc加载不同界面的切换方法
需求:tabbar默认加载A界面,点击了某一按钮/请求了某一个接口后默认加载B界面1⃣️错误思路原创 2019-05-29 22:51:16 · 872 阅读 · 0 评论 -
iOS开发之视频兼容及网页无法播放的解决办法
在做视频上传到阿里云时我碰到了以下几个问题:1.web端无法播放使用iPhone xs max与iOS11系统录制的视频;2.10.0的6s与5s没法播放iOS11及以上录制的视频;解决方法:由于我们的视频是直接转化为data上传至阿里云的,阿里云以及本地没有对.mov结尾的视频做处理。现得出以下两种解决方法。1.阿里云开通视频转码服务,此方法需要付费以及后台配置。2.iOS端将获取到...原创 2019-06-24 13:39:15 · 4832 阅读 · 0 评论 -
ERROR ITMS-90596: "Invalid Bundle. The asset catalog at 'Payload/Application.app/Assets.car' can't b
1.打包提交到appstore时出现以下提示:ERROR ITMS-90596: "Invalid Bundle. The asset catalog at 'Payload/Application.app/Assets.car' can't be read. Try rebuilding the app with a non-beta version of Xcode and submi原创 2018-01-29 10:48:09 · 3585 阅读 · 0 评论 -
给键盘添加确认/剩余字数按钮,并且改变超过剩余个数局部文字颜色
eg:@property (nonatomic,strong) UILabel *remainLabel;@property (nonatomic,strong) UIButton *completeBut;// 关于View和but的配置- (void)setUpWithKeyBoardVi原创 2018-02-02 10:36:56 · 336 阅读 · 0 评论 -
iOS开发之tableview位置错乱,偏移,回到原来位置
上拉刷新后发现数据位置错乱?tableview的偏移不对?比如数据一共有40条,一次加载20条,正常应该显示在第21条,上拉时加载后发现tableview停在了第11条或者30几条,如果你发生了和我一样的情况,那看这里- (void)addRefresh {__weak typeof (self) weakSelf = self;weakSelf.nomalTable.mj_header原创 2018-01-09 18:44:57 · 4395 阅读 · 0 评论 -
自己创建storyboard
自己创建的方法如果文件名不是main 那个地方需要修改让箭头出现需要勾选默认yes 需要取消对勾关联文件输入文件名 如果有类会有提示实现界面跳转原创 2016-03-18 13:19:34 · 459 阅读 · 0 评论 -
开发中总结的一些小的知识点,陆续更新中
1⃣️__VA_ARGS__在GNU C中 红可以接受可变数目的参数 就像函数一样可以把 __VA_ARGS__看成是将赋值给该宏//注意这里不能在函数中调用abc()#include #include #define ABC(...) printf(__VA_ARGS__)/*void abc(...){原创 2016-03-18 13:49:19 · 414 阅读 · 0 评论 -
iOS开发之学习链接
1.MQTT实战篇 http://www.jianshu.com/p/b093fe6c3f10 2.iOS 单元测试 http://www.jianshu.com/p/8bbec078cabe 3.面试题 http://www.cocoachina.com/ios/20150803/12872.html http://blog.sunnyxx.com/2015/07/04/ios-int原创 2016-09-23 14:21:02 · 333 阅读 · 0 评论 -
Xcode7下真机配置iOS10
Xcode真机测试时出现Could not find Developer Disk Image在使用Xcode进行真机调试的时候,有时根据真机的系统不同,这是由于真机系统过高或者过低,Xcode中没有匹配的配置包文件,我们可以通过这个路径进入配置包的存放目录: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platfor原创 2016-09-24 16:41:13 · 1189 阅读 · 0 评论 -
iOS开发之使用颜色生成图片
-(UIImage) createImageWithColor:(UIColor) color { CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphicsGetCurrentContext(); CGCo原创 2016-10-14 11:12:42 · 928 阅读 · 0 评论 -
iOS开发之导航栏的一些小功能
1.隐藏/去掉 导航栏返回按钮中的文字 [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60) forBarMetrics:UIBarMetricsDefault];2.设置statusBar颜色为白色 self.navigationController.naviga原创 2016-10-14 11:15:57 · 329 阅读 · 0 评论 -
iOS开发之实时监测textField输入变化
// 我这里控制的是输入用户名和密码长度控制,通过这个来设置登录按钮能不能点击 [self.accountText addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged]; [self.passwordText addTarget:self ac原创 2016-10-14 11:18:59 · 3273 阅读 · 0 评论 -
iOS开发之app之间的跳转以及跳转到appstore
1.A程序跳到B程序 一: 找到info.plist文件,注册对外接口 流程:在Information Property List 点击 + 号,添加一个叫(URL types)的数组, 将item0下将URL identifier 改为 (URL Schemes),再点击 + 号添加一个(item1),将item1的值设置为:(myapp) 这个myapp就是对外接口,可以通过它,调用原创 2016-10-14 14:01:02 · 711 阅读 · 3 评论 -
iOS开发之Your build settings specify a provisioning profile with the UUID “”, however, no such provisio
出现错误原因可能为 1.由付费的账号替换成了免费的 2.证书更替但没有匹配好我在网上看到的解决方法: 1.找到项目中的*.xcodeproj文件,点击右键,show package contents(打开包内容)。 2.打开后找到project.pbxproj文件,用文本编辑器打开。其实就是右键,点击open就好了。 3.打开这个文件后,按command+F,在这个文件中查找“PROVIS原创 2016-10-17 15:31:24 · 332 阅读 · 0 评论 -
iOS开发之跑马灯
1.法一: 类似于弹幕,一个label的实现 - (void)viewDidLoad { [super viewDidLoad]; [self addPaomaLabel]; }(void)addPaomaLabel { self.annonLabel = [[UILabel alloc]initWithFrame:CGRectMake(45, 8, ScreenWidt原创 2016-11-01 14:47:11 · 471 阅读 · 1 评论 -
iOS开发之TouchId
// 需求: 通过touchId进行登录,我把账号与密码使用keychain存储了LoginViewModel // 这里只是登录请求的例子 - (void)requestLoginStart { // 这里进行网络请求,登录成功,返回结果 if(succ) { // 使用keychain存储登录密码 [PassWordTool savePass原创 2016-12-16 13:00:01 · 465 阅读 · 0 评论 -
Could not find a storyboard named 'Main' in bundle NSBundle </Users/liuyuhang/Library/Developer/Core
Could not find a storyboard named ‘Main’ in bundle NSBundle 其实是因为我在加载时将main.storyboard删除了 在这里设置成launchScreen加载就行啦appdelegate再去设置自己的根视图原创 2017-12-21 11:36:39 · 3255 阅读 · 0 评论 -
原简书博客不再更新,原代码也不再转移
老博客地址为:http://www.jianshu.com/u/c86b8eb42964原创 2017-12-21 11:40:59 · 294 阅读 · 0 评论 -
iOS开发之获取indexPath等于nil
当你的cell上是按钮点击时 // 关注方法- (void)focusOn:(UIButton *)but { WBNomalCollectionViewCell *cell = (WBNomalCollectionViewCell *)[[but superview] superview]; NSIndexPath *indexPath = [self.nomalTable原创 2017-12-13 18:33:34 · 1996 阅读 · 0 评论 -
关于iPad app适配iphone
最近公司需要将iPad app适配到手机上,不过这个iPad app不算复杂,下面我就把我适配过程中的经验发出来1.iPad界面布局和手机布局差距太大怎么办这是我的iPad的登录界面,我是storyboard直接拖的界面下面看代码部分 if (iPhone) { self.logTopDistance.原创 2018-01-30 17:31:12 · 2805 阅读 · 0 评论 -
微信支付与友盟分享冲突[!] The 'Pods-StudentGrowth' target has libraries with conflicting names: libwechatsdk.a.
[!] The ‘Pods-StudentGrowth’ target has libraries with conflicting names: libwechatsdk.a.我在用pods导入微信支付sdk时报了这么一个错,因为友盟里的微信sdk和支付的sdk冲突了 我的解决方法是先移除再手动导入 1.移除pods里的友盟分享相关代码 2.使用pods导入微信支付(Using Wec原创 2018-01-02 11:45:59 · 4856 阅读 · 0 评论 -
限制输入字数
- (BOOL)textField:(UITextField*)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString*)string;{//string就是此时输入的那个字符textField就是此时正在输入的那个输入框返回YES就是可以改变输入框的值NO相反原创 2016-03-29 10:39:57 · 320 阅读 · 0 评论