- 博客(93)
- 资源 (12)
- 问答 (1)
- 收藏
- 关注
原创 safari地址栏无法使用百度搜索
解决方案:1.随便在地址栏输入个词语,然后同时按住 command+return,在新标签就可以打开搜索结果2.点击Safari的「历史记录」--清空历史记录3.重启Safari
2016-05-27 20:21:27
5589
转载 NSTimer、CADisplayLink、GCD 三种定时器的用法
在软件开发过程中,我们常常需要在某个时间后执行某个方法,或者是按照某个周期一直执行某个方法。在这个时候,我们就需要用到定时器。在iOS中有很多方法完成定时器的任务,例如 NSTimer、CADisplayLink 和 GCD都可以。 一、NSTimer1. 创建方法 NSTimer *timer = [NSTimer scheduledTimerW
2016-04-24 21:14:02
634
转载 apps被拒绝的各种理由以及翻译
1. Terms and conditions(法律与条款)1.1 As a developer of applications for the App Store you are bound by the terms of the Program License Agreement (PLA), Human Interface Guidelines (HIG), an
2016-03-26 14:25:34
1127
转载 Copy和MutableCopy
1.copy:不可变复制 2.mutableCopy:可变复制ios中并不是所有的对象都支持copy,mutableCopy,遵守NSCopying 协议的类可以发送copy消息,遵守NSMutableCopying 协议的类才可以发送mutableCopy消息。假如发送了一个没有遵守上诉两协议而发送 copy或者 mutableCopy,那么就会发生异常。但是默认的i
2016-03-15 21:31:39
411
转载 iOS子视图捕获到的touches如何让父视图响应
用代理实现最简单了,子视图声明一个protocol和与之对应的method和delegate property,然后父视图实现。例如:子视图SonView.h:@class SonView; //这个必不可少,因为真正的class interface在下面声明,而在protocol声明中又要用到这个class,所以提前告诉XCode有这么一个class存在@protocol S
2016-03-12 12:06:12
2953
转载 Cannot proceed with delivery: an existing transporter instance is currently uploading this package
方法一:把Application Loader(XCode->Organizer->Archived Applications->Submit)中正在上传的文件中断或者删除,再次Submit提示:Cannot proceed with delivery: an existing transporter instance is currently uploading this package
2016-03-04 22:06:43
648
转载 iOS开发证书失效--Missing iOS Distribution signing identity
今早上班打包直接报错,错误如图1.png根据错误信息到“钥匙串”里面看了一下证书,证书都莫名其妙的失效了,昨天还是好好的。折腾了半天才找到解决方案。第一种方法:1.打开系统中 钥匙串2.点击左上钥匙串中的"登录",在点击左下种类中的"证书"3.选择"Apple Worldwide Developer Certification Authori
2016-02-19 10:12:01
1052
转载 UIScrollView基本用法和代理方法
1234567891011121314151617181920212223242526272829303132333435
2016-02-15 15:39:01
323
转载 UIImageView的属性
窗口大小获取: CGRect screenBounds = [ [UIScreenmainScreen]bounds];//返回的是带有状态栏的RectCGRect rect = [ [UIScreenmainScreen]applicationFrame];//不包含状态栏的RectUIImageView:一 :圆角以及自适应图片大小 UIIma
2016-01-28 15:49:37
407
原创 iOS数组和字典转Json字符串
+ (NSString *)dictionaryToJSONString:(NSDictionary *)dictionary { NSError *error = nil; NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dictionary options:NSJSONWritingPrettyPri
2016-01-27 17:08:08
14274
转载 UITableViewCell的点击事件而不是select事件
继承UITableViewCell的类里实现这个方法:-(void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated{ if (highlighted == YES) { }else{ } [super setHighlighted:highlighted a
2016-01-20 11:04:12
356
转载 iOS获取xcassets中LaunchImage图片
NSDictionary * dic = @{@"320x480" : @"LaunchImage-700", @"320x568" : @"LaunchImage-700-568h", @"375x667" : @"LaunchImage-800-667h", @"414x736" : @"LaunchImage-800-Portrait-736h"};NSString * key
2016-01-19 10:36:02
1051
转载 iOS监测第三方键盘高度
- (void)keyboardWillShow:(NSNotification *)notification { CGFloat curkeyBoardHeight = [[[notification userInfo] objectForKey:@"UIKeyboardBoundsUserInfoKey"] CGRectValue].size.height; CGRect beg
2016-01-11 16:54:14
615
转载 中国天气网 天气预报API 国家气象局 根据城市名称抓取城市ID,XML格式、JSON格式、图片代码
说到开发天气预报,就需要找一个开放接口了,接口有很多,不过个人觉得,中国天气网的数据比较准确,而且也有权威性。访问地址如:http://m.weather.com.cn/data/101010100.html,这是北京的天气URL,其中101010100就是城市代码了,比如西安的天气URL为:http://m.weather.com.cn/data/101110101.html,
2016-01-11 14:57:07
11557
转载 clipsToBounds属性
clipsToBounds属性取值:BOOL(YES/NO)作用:决定了子视图的显示范围。具体的说,就是当取值为YES时,剪裁超出父视图范围的子视图部分;当取值为NO时,不剪裁子视图。默认值为NO。如下图所示:view2是view1的子视图.
2016-01-11 14:54:06
724
原创 UITableViewCell的accessoryType属性
cell.accessoryType = UITableViewCellAccessoryNone;//cell没有任何的样式 cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;//cell的右边有一个小箭头,距离右边有十几像素; cell.accessoryType = U
2016-01-04 15:11:24
457
转载 iOS自动消失提示框
+(void)showMessage:(NSString*)message{ UIWindow* window = [UIApplicationsharedApplication].keyWindow; UIView*showview = [[UIViewalloc]init]; showview.backgroundColor =
2015-12-30 11:21:04
411
原创 iOS UITextField输入字数提示以及判断输入字体类型
1.创建UITeextField并设置delegateUITextFieldDelegateeditText = [[UITextField alloc] initWithFrame:CGRectMake(20, 40, ScreenSize.width-40, 40)]; editText.backgroundColor = [UIColor whiteColor];
2015-12-30 11:17:55
684
原创 iOS真机开机图片不显示
图片配置尺寸根据不同机型对应响应图片尺寸。解决方案:1.检查图片尺寸是否正确。2.图片命名不能重复。3.横竖屏命名。4.删掉原来的APP,重新打一个看看。5.将启动页面停留时间设长一些看看:[NSThread sleepForTimeInterval:5.0]。6.真机上文件名是区分大小写的 。
2015-12-29 11:33:26
1727
原创 iOS cell重用机制导致数据重叠显示解决方法
当页面拉动需要显示新数据的时候,把最后一个cell进行删除就有可以自定义cell 此方案即可避免重复显示。 // 定义唯一标识 static NSString *CellIdentifier = @"Cell"; // 通过唯一标识创建cell实例 UITableViewCell *cell = [tableView dequeueReusableCellWithI
2015-12-28 13:57:37
1254
转载 iOS把字符串汉字转换成UTF-8编码
ASCII码相信很熟悉了,只是自己一直都记不住基本规律,有时候用起来十分不爽。ASCII,共7位,表示128个字符,一般都在前面加0补全8位形成一个Bit。0~31以及127为控制字符,不能打印;32为空格;48(HEX: 0x30)为0;65(HEX: 0x41)为A;97(HEX: 0x61)为a。GB2312:ANSI编码中的一种,对ASNI编码最初始的ASCII
2015-12-28 13:14:47
1217
转载 iOS刷新某个cell时候crash
//一个section刷新 NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2]; [tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic]; //一个cell刷新 NSIndexPat
2015-12-28 12:50:34
775
转载 iOS错误提示:-[UITextSelectionView chatTextViewTextChange]: unrecognized selector sent to instance 0x7f
首先,自定义一个UIView的子类,然后在这个类里,注册了一个消息中心, addObserve, 当我这个类重新创建一个UIview的时候, 就会神奇的crash, 后来发现...是因为这个消息中心没有被移除的原因// 解决方法: 在注册通知的那个类对应的dealloc 写上[[NSNotificationCenter defaultCenter] removeObserver:se
2015-12-28 12:48:51
1069
原创 iOS报错:does not contain bitcode
错误信息:does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture
2015-12-25 16:19:46
1289
原创 ld: 1 duplicate symbol for architecture arm64 clang: error: linker command failed with exit code 1
目标文件重复,通过 target - build phases - compile sources 找出重复的类。
2015-12-25 16:14:21
1307
原创 ViewController生命周期
ViewController的职责主要包括管理内部各个view的加载显示和卸载,同时负责与其他ViewController的通信和协调。在IOS中,有两类ViewController,一类是显示内容的,比如UIViewController、UITableViewController等,同时还可以自定义继承自UIViewController的ViewController;另一类是ViewContro
2015-12-24 11:24:42
421
转载 iOS静态库的制作
什么是库?库是程序代码的集合,是共享程序代码的一种方式根据源代码的公开情况,库可以分为 2 种类型开源库公开源代码,能看到具体实现比如 SDWebImage 、 AFNetworking闭源库不公开源代码,是经过编译后的二进制文件,看不到具体实现主要分为:静态库、动态库静态库和动态库静态库和动态库的存在形式静态库: .a
2015-12-23 17:55:43
423
原创 ios 日期和星期的获取
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];NSDate *now;NSDateComponents *comps = [[NSDateComponents alloc] init];NSInteger unitFlags = NSYea
2015-12-23 12:11:28
364
原创 iOS ARC和MRC切换
在targets->build phases中修改compiler Flags,是否支持arc。添加:-fobjc-arc,就可以让旧项目支持arc。如果想让原来支持arc的不使用arc则添加-fno-objc-arc
2015-12-23 11:42:13
905
转载 iOS网络收音机
通过百度媒体云来实现网络收音机进入SDK下载界面,下载iOS开发包http://developer.baidu.com/wiki/index.php?title=docs/cplat/media/video/sdk 注:我下载的包见下图,但是发现有些问题,具体啥问题在这不详细说了,如果你运行Demo也遇见这个问题的话,那就接着往下看2.添加媒体云包
2015-12-23 11:37:04
1935
原创 iOS本地通知
AppDelegate1,注册苹果的通知12345678- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
2015-12-23 11:33:21
523
原创 UICollectionView的下拉刷新无法滑动
当cell很少的情况下(没有占满屏幕),collectionView不能拖动,这个时候就不能拖拽collectionView进行下拉刷新了。解决方法:当所有collectionCell的高度和没有占满整个parent container的时候,当下拉的时候都不会触发scrollViewDidScroll。所以在创建collectionView的时候添加 self.colle
2015-12-23 11:29:05
935
原创 TableView如何刷新指定的cell 或section和滚动到制定位置
//一个section刷新 NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2]; [tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic]; //一个cell刷新 NS
2015-12-23 11:20:33
6814
转载 iOS 图片加载方式
正确选择图片加载方式能够对内存优化起到很大的作用,常见的图片加载方式有下面三种:[objc] view plaincopy//方法1 UIImage *imag1 = [UIImage imageNamed:@"image.png"]; //方法2 UIImage *image2 = [UIImage imageWi
2015-12-23 10:43:32
364
转载 iOS开发之16进制颜色(html颜色值)字符串转为UIColor
互联网 App 中经常会用到 html 颜色值转换 UIColor,比如:#FF9900、0XFF9900 等颜色字符串,以下方法可以将这些字符串转换为 UIColor 对象。+ (UIColor *) colorWithHexString: (NSString *)color{ NSString *cString = [[color stringByTrimmingChar
2015-12-23 10:40:38
462
原创 使用AFNetworking时遇到了 property synthesis 相关的 error
Auto property synthesis will not synthesize property 'request' because it is 'readwrite' but it will be synthesized 'readonly' via another propertyAuto property synthesis will not synthesize pro
2015-12-23 10:37:37
337
原创 iOS收藏图片到本地相册
将网络请求下的图片保存在本地相册,代码如下:#pragma mark 保存图片到本地相册 self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@""] style:UIBarButtonItemStylePlain ta
2015-12-22 18:16:35
472
原创 iOS界面跳转动画
PUSH:[UIView beginAnimations:nil context:NULL]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:0.75]; [self.navigationController pushV
2015-12-22 18:11:04
346
原创 switch case语句里面不能定义对象 错误信息:Cannot jump from switch statement to this case..
错误如图:只要在花括号 “{ }”中定义的对象,那么该对象的作用域就局限在这对花括号里面,上面的代码的错误就出现在这儿了。
2015-12-22 15:37:03
18433
2
iOS9新特性介绍及解决方案(包括Xcode)
2015-12-11
微信QQ新浪微博第三方登陆最新支持iOS9 64位 无BUG版
2015-12-08
请教iOS中CMPedometer的用法
2015-04-27
TA创建的收藏夹 TA关注的收藏夹
TA关注的人