- 博客(103)
- 资源 (3)
- 收藏
- 关注
原创 iOS 使用SDWebImage加载gif链接图片时内存过大问题
公司项目要展示gif动画效果,原本使用SDWebImage的方式加载链接gif,但是发现一个非常大的问题,内存暴涨,导师真机测试闪退.不过,使用了另一位大神写的YYWebImage完美解决了我的问题gitHub:YYWebImage下载地址
2016-10-10 17:58:47
6353
原创 iOS for循环创建button,button的宽度根据上面的文字来自适应.
最近需要使用一个标签页,寻思自己写一个demo.标签的大小根据上面的文字来自适应大小,需要根据后台返回的数据自动换行.没有添加NSArray *arr = @[@"无知",@"风云变幻",@"施耐庵",@"唉",@"西门吹雪",@"呵呵哒",@"快看看",@"窿窿啦啦",@"一杆禽兽狙",@"合欢花",@"暴走大事件",@"非诚勿扰",@"呵呵呵"]; CGFloat w
2015-07-23 16:41:42
10062
原创 iOS 字体样式
UILabel *label = [UILabel alloc] init];inLabel.font = [UIFontfontWithName:@"Snell Roundhand"size:13];2015-06-19 09:30:38.891 Interest[860:26980]所有字体( Marion, Copperplate,
2015-06-19 09:35:20
979
原创 SVN Working copying 'xxxxx/xxxx/xxxx' locked
使用SVN想更新上传时提示Working copying 'xxxx/xxxx/xxx' locked解决方法:选中你的项目,上面工具栏一行找到 Action → Cleanup all Working Copy Locks
2015-06-05 09:52:52
2250
原创 iOS 集成高德地图无法定位问题
1.最近的一个项目需要地图定位,.之前使用高德地图可以定位,最近的这个项目,又一次需要集成时,却无法定位.郁闷一上午.后来仔细检查,发现问题所在原因: 之前集成高德地图我是手动配置的,这一次我选择了自动配置,使用cocopods命令方式,集成的.最终发现原因是:需在info.plist中追加NSLocationWhenInUseUsageDescription或NSLocat
2015-05-04 18:01:16
2983
原创 iOS 8 状态栏保持黑底白字 亲测有效
1.info.plist文件 设置View controller-based status bar appearance的值为no2.在AppDelegate.m中添加如下代码if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { [application setStatusBarStyle:UI
2015-04-15 14:08:17
1047
转载 iOS 使用高德地图 MAMapView 无法定位的问题
//模拟器是无法定位的,必须真机上http://blog.youkuaiyun.com/johnzhjfly/article/details/39497751在iOS8的设备上,使用高德地图SDK你会发现MAMapView里的回调位置是空的。-(void)mapView:(MAMapView*)mapView didUpdateUserLocation:(MAUserLocation*
2015-04-15 11:40:28
4176
原创 no rule to process file "xxxxxxxxx" of type XXXXXX.h for architecture i386解决办法
1.每次遇到黄色警告就头疼,一方面log一大堆,不想看.二来解决麻烦.2直接说解决办法TARGET →Build Phases → Compile Source→ 删除报错的xxxxx.h文件 → clean工程→编译(OK,解决),你要没解决我也没办法
2015-04-14 11:56:57
21473
原创 iOS 遇到指定字符进行截取
NSString *str = @"a&aa&aaa&aaaa&aaaa";NSArray *arr = [strcomponentsSeparatedByString:@"&"];NSLog(@"%@----",arr);打印结果( a, aa, aaa, aaaa, aaaa)----
2015-03-30 18:00:45
599
原创 iOS 使用MJRefrsh上拉加载,下拉刷新cell不充满UICollectionView时不能刷新的问题
iOS 使用MJRefrsh上拉加载,下拉刷新cell不充满UICollectionView时不能拖动collectiobView,因此不能实现刷新和加载解决办法:1.春代码法:self.collectionView.alwaysBounceVertical = YES;2.可视化编程Xib法
2015-03-23 17:50:18
2197
原创 switch case is in protected scope解决办法
出现错误:switch case is in protected scope一半情况下这种写法:switch (XXX) { case XXX: XXXX break; default: break; }解决办法
2015-03-17 15:35:51
1245
原创 Xcode6.0 解决无法输入中文的办法.
使用Xcode6.0模拟器不能在textField里面输入中文,也切换不过来,模拟器也添加了中文键盘,还是不能切换键盘输入中文.解决办法:选中Xcode →product→ scheme → Edit scheme→ run → options→ application Region 选项改为“中国”然后就可以输入中文了
2015-03-10 16:40:17
3488
1
原创 [ XXX handleSegmentControl:]: unrecognized selector sent to instance 0x7fe2de49a8e0
[ XXX handleSegmentControl:]: unrecognized selector sent to instance 0x7fe2de49a8e0我的错误原因每个人的可能不一样,分享一下:原因:我用XIB建的UISegmentControl,添加的方法,之前添加过一次响应方法,后来删除,又重新添加了一次响应方法,导致响应方法有两个,有冲突.如图解决办法:删
2015-03-05 11:57:43
1105
原创 Too many arguments to function call ,expected 0,have3
使用MJRefresh上拉加载,下拉刷新时,导入包后,编译出现:Too many arguments to function call ,expected 0,have3网上解决解决办法:Build Setting--> Apple LLVM 6.0 - Preprocessing--> Enable Strict Checking of objc_msgSend Calls 将YES
2015-03-02 11:43:30
1973
转载 MKNetworkkit uses features only available in iOS SDK 4.0 and later
导入第三方库MKNetworkKit出错MKNetworkKit uses features only available in iOS SDK 4.0 and later报错解决方案MKNetworkKit是一个非常优秀的网络请求框架,但是相比很多人第一次从github上下载配置的时候都遇到了报错问题。MKNetworkKit uses features only availab
2015-02-27 16:19:11
701
原创 reason: 'Could not load NIB in bundle: "XXXXXXX" with name 'xxCell'
错误信息:reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'collectViewCell''查找原因:UICollectionView注册的是时候出错;如下:[self.collectionView registerNib:[UINib nibWithNibName:@"sch
2015-02-14 15:08:40
3773
原创 iOS The file “XXX” couldn’t be opened because you don’t have permission to view it.
打开一个工程编译运行出现iOS The file “UIMenuBarDemo” couldn’t be opened because you don’t have permission to view it.搜资料,解决方法:点击工程出现的警告,会出现如下图所示:点击 Preform Changes继续就OK了
2015-02-10 10:39:36
1338
原创 -pie can only be used when targeting iOS 4.2 or laterclang: error: linker command failed with exit c
在code4App上下载的一个下拉菜单的demo,打开就爆出标题所示的问题.解决方法:TARGET→ general → DeployMent info → Deployment Tagget 把版本设置高一点就OK了.每天一点积累.......
2015-02-05 12:51:25
835
原创 Too many arguments to function call ,expected 0,have3
使用MJRefresh刷新,导入工程中,爆出:Too many arguments to function call ,expected 0,have3解决方法:Build Setting--> Apple LLVM 6.0 - Preprocessing--> Enable Strict Checking of objc_msgSend Calls YES改为 NO
2015-02-05 12:47:00
1142
原创 cocoaPods使用出现:Setting up CocoaPods master repo
cocoaPods使用出现:Setting up CocoaPods master repo时;切莫慌张,耐心等待就行了,第一次用cocoaPods出现这个情况很正常.
2015-02-04 17:47:45
1400
原创 使用cocoaPods出现:incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)
使用cocoaPods安装AFNetworking时出现:incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)原因是:Podfile文件里面的内容格式有问题,检查你的标点符号是否是在英文状态下输入的:platform :ios, '7.0'pod "AFNetwor
2015-02-04 17:44:35
5341
1
转载 iOS UITextField用法大全
UITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(20, 20, 130, 30)]; //初始化textfield并设置位置及大小text.borderStyle = UITextBorderStyleRoundedRect; //设置边框样式,只有设置了才会显示边框样式 typedef
2015-02-04 11:30:59
596
原创 -boundingRectWithSize:options:attributes:context:用法
导入第三方一些类库后,出现一些警告就是某些方法被弃用了:如:- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(NSLineBreakMode)lineBreakModeNS_DEPRECATED_IOS(2_0,7_0, "Use -boundingRectWith
2015-02-04 11:18:57
1170
原创 二维码扫描(ZBar,ZXing不知道有没有问题)与arm64的问题.
做二维码扫描的时候,查了一些资料,都说ZBar的功能更全面一些,于是就用了ZBar的开源代码,导入工程中,编译一直出错主要错误信息: Undefined symbols for architecture x86_64:查了一些资料,有说把TARGET→Builte Setting→Vaild Architecture 中armv7s和arm64删除只保留armv7,虽然暂时可以解决问题
2015-02-03 09:03:31
1612
原创 Undefined symbols for architecture x86_64:
今天开始搞二维码扫描的用的是ZBarSDK下载了 ZBarSDK下载地址,导入那几个框架后,以及代码后编译就出现 Undefined symbols for architecture x86_64:的问题,调试很久才解决.一把辛酸泪啊.解决办法:TARGETS→Build Setting→ValidArchitectures → 把里面全都删了只剩下armv7就行了.编译又出现如下问
2015-02-02 11:17:21
1584
原创 iOS 真机测试 爆红 png问题
iOS真机测试,自己一个人搞,问问多多.真机测试的运行出现 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng emitted errors but did not return a nonzero exit code to indicate fai
2015-01-28 14:21:27
584
原创 iOS App Development 第一个选项呈灰色不能选问题.
第一次整真机测试,啥都不懂,看了网上的教程,跟着一步一步走,到如图片锁匙这一步,就跟网上的不一样了.成灰色状态,不能勾选,那叫一个急,搜资料才知道问题.解决办法:把已经创建好的证书revoke一个就行了,证书最多好像3个,成灰色说明已经满了.revoke一个就行了.你要问我怎么找不到revoke,我会告诉你点击证书就出在下方出现.(
2015-01-28 12:03:24
5163
1
原创 调去系统照相机或者从本地相册获取图片.
1.首先要遵守三个协议UIActionSheetDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate2.主要代码//选择头像- (IBAction)handleSelectImage:(id)sender { self.myActionSheet = [[UIAc
2015-01-26 17:38:05
891
原创 implicit conversion loses integer precision :'long' to 'int'
Xcode升级以后,打开以前的代码出现了这个错误;解决的办法::依据自己的具体情况,进行强制类型转换.
2015-01-15 09:13:09
1455
原创 this class is not key value coding-compliant for the key btn
使用xib创建button时,出现的错误,原因是因为为这个button留接口时,第次出错,就删除了,重新命名了,造成第一次的命名的名字还连线使用.解决办法:把第一次连线的btn的连线删除就可以了.
2015-01-13 15:22:42
647
原创 incompatible pointer types assigning to 'nsmutablearray ' from 'nsarray '
这是因为NSMutableArray和NSArray不是同一个类型造成的.解决方法// NSArray --> NSMutableArray NSMutableArray *myMutableArray = [myArray mutableCopy];// NSMutableArray --> NSArrayNSArray *myArray = [myMutableArr
2015-01-09 17:10:08
2290
原创 An error was encountered while running (Domain = FBSOpenApplicationErrorDomain, Code = 4)
这个问题解决办法: 1.重启iOS模拟器 2.[iOS Simulator] >>> [Rest Contents and Settings...] >>> [Reset]
2015-01-09 10:41:10
722
原创 下拉放大效果
static CGFloat headerHeight = 250;static CGFloat headerWidth = 320;- (void)scrollViewDidScroll:(UIScrollView *)scrollView{ CGFloat yOffset =_collectionView.contentOffset.y; i
2014-10-09 22:07:54
659
原创 cocoaPods的安装和使用
打开终端按下面步骤:1.移除ruby的原地址gem sources --remove https://rubygems.org/2.添加ruby的原地址gem sources -a http://ruby.taobao.org/3.查看ruby的源地址gem source -l4.安装cocoapodssudo gem install cocoapods
2014-10-06 13:09:14
773
原创 iOS模态切换视图的四种不同风格
typedef NS_ENUM(NSInteger, UIModalTransitionStyle) { UIModalTransitionStyleCoverVertical =0,//xia'xia UIModalTransitionStyleFlipHorizontal, UIModalTransitionStyleCrossDissolve,#if
2014-09-15 19:31:21
712
原创 iOS将输入框的文字存入本地文件中
UITextField *tf = (UITextField *)[self.viewviewWithTag:1000]; NSString *content = tf.text; //2.获取到所要存储的文件路径 /** * Documents文件夹路径 @param NSdocumentDirectory指定的文件夹(是Documen
2014-09-09 13:33:30
797
原创 UITableViewDataSource和UITableViewDelegate内常用的13个方法
@protocol UITableViewDataSource@required//设置分组的行数- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;//创建cell,每一个行(row)对应一个cell- (UITableViewCell *)table
2014-09-05 13:27:47
802
转载 iOS打电话的两种方法
第一种方式 NSString *phone = @“88888888” if (phone != nil) { NSString *telUrl = [NSString stringWithFormat:@"telprompt:%@",phone]; NSURL *url = [[NSURL al
2014-09-04 19:17:02
655
一个简单提醒界面
2014-08-23
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人