自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(44)
  • 收藏
  • 关注

原创 Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: bad request (400)

报错的原因,可能有两个(1)url写错了(2)参数的内容写错了仔细检查这两项就可以了

2015-12-15 16:48:41 13881 2

原创 directory not found for option

升级xcode7报以下警告ld: warning: directory not found for option ‘-F/Applications/Xcode 7.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Fr

2015-12-11 19:33:21 437

转载 xcode因为cocoapods打不开

运行Xcode软件打不开,提示因为cocoaPod插件故障,想通过终端删除cocoaPods插件,发现Mac终端打开出现以下异常: [forkpty: Resource temporarily unavailable]  [未能创建新的进程和打开伪终端 (pseudo-tty)。~/Library/Application Support/Developer/Shared/Xco

2015-12-10 11:16:50 1582

原创 App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.

在info.plist中,加入以下key

2015-11-30 21:26:05 267

转载 Xcode7 网络请求报错:The resource could not be loaded because the App Transport Security policy requir

Google后查证,iOS9引入了新特性App Transport Security (ATS)。详情:App Transport Security (ATS)新特性要求App内访问的网络必须使用HTTPS协议。但是现在公司的项目使用的是HTTP协议,使用私有加密方式保证数据安全。现在也不能马上改成HTTPS协议传输。最终找到以下解决办法:在Info.plist中添加NSA

2015-10-28 12:59:58 417

转载 NSString writeToFile方法中的atomically

如果为yes,原子性:先创建一个临时文件,直到文件内容写入成功再导入目标文件如果为no,非原子性,直接写入目标的文件

2015-10-17 21:33:13 824

原创 Core Location Manager Changes in iOS 8 英文文档

http://nevan.net/2014/09/core-location-manager-changes-in-ios-8/

2015-10-13 08:35:26 280

原创 Error Domain=kCLErrorDomain Code=0 "The operation couldn’t be completed. (k

修改当前位置,不行的话,就重置模拟器

2015-10-13 08:33:37 288

原创 不能约束两个视图,在没有一个公共superview的情况下

'Can't constrain two views that do not share a common superview. Make sure that both views have been added into the same view hierarchy.        YCDropDownMenuView *menu = [YCDropDownMenuView

2015-09-25 22:51:16 751

原创 不想让cell显示选中的状态

重写 cell 的方法,将不会出现选中时的backgroundView- (void)setSelected:(BOOL)selected animated:(BOOL)animated {}

2015-09-20 00:13:37 217

转载 Attempting to badge the application icon but haven't received permission from the user to badge the

(1)原因一切都是iOS8捣的鬼。您如果把模拟器换成iOS7.1或者更早的,就不会有这个问题。而现在在iOS8中要实现badge、alert和sound等都需要用户同意才能,因为这些都算做Notification“通知”,为了防止有些应用动不动给用户发送“通知”骚扰用户,所以在iOS8时,要“通知”必须要用户同意才行。(2)解决思路:我们判断一下,如果系统版本大于等于8.0的话,我们就在用

2015-09-17 07:25:27 279

原创 UITextView内容添加后,自动滚动到最后一行

self.textView.layoutManager.allowsNonContiguousLayout = NO;  // 默认是 YES

2015-09-15 21:41:01 421

转载 iOS8中UIBarButtonItem的setTitleTextAttributes对Disabled颜色设置无效

解决方法: 在viewWillAppear:方法中  设置item的enabled属性原文地址:http://www.itnose.net/detail/6192088.html

2015-09-13 15:35:37 476

转载 UIViewContentMode

UIViewContentModetypedef enum {    UIViewContentModeScaleToFill,    UIViewContentModeScaleAspectFit,      // contents scaled to fit with fixed aspect. remainder is transparent    UIViewCon

2015-09-12 14:44:03 282

转载 升级Xcode之后VVDocumenter-Xcode不能用的解决办法

原文地址: http://www.bubuko.com/infodetail-922634.html一、查看Xcode的UUID在终端执行 defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID二、添加Xcode的UUID到VVDocumenter-

2015-09-04 18:13:13 288

转载 Attempting to badge the application icon but haven't received permiss...

在appdelegate中添加如下代码即可- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { float sysVersion=[[UIDevice currentDevice]systemVersion].floatVa

2015-09-04 15:17:47 589

原创 介绍 UIViewControllerTransitionCoordinator(翻译不到之处望多多提)

一个采用UIViewControllerTransitionCoordinator协议的对象,给视图控制器转场动画提供相关支持。通常来说,你不需要采用这个协议在自己的类中。当你展现或者退出一个视图控制器时,UIKit会自动创建一个转场协调器对象,并且给视图控制器的transitionCoordinator属性赋值。这个转场协调器对象是短暂的,并且延续到转场动画的结束。      你可以使用一个

2015-08-11 20:08:58 3109

原创 [UIPopoverController dealloc] reached while popover is still visible

popover 可见的时候,不可以销毁对象, 此时应采取的措施是,定义一个strong属性,来引用这个popover

2015-08-10 10:32:40 659

转载 Objective-C编码规范:26个方面解决iOS开发问题

语言应该使用US英语。应该:UIColor *myColor = [UIColor whiteColor];  不应该:UIColor *myColour = [UIColor whiteColor];  代码组织在函数分组和protocol/delegate实现中使用#pragma mark -来分类方法,要遵循以下一般结构:#pragma mar

2015-07-16 21:52:22 324

转载 UITableView启动后自动设置滚动的位置

2015-07-06 22:37:13 311

原创 不更改时区,会返回一个空的NSDate对象

更改时间格式化对象的locale

2015-06-13 09:57:59 328

转载 日期格式化

在开发iOS程序时,有时候需要将时间格式调整成自己希望的格式,这个时候我们可以用NSDateFormatter类来处理。例如://实例化一个NSDateFormatter对象NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];//设定时间格式,这里可以设置成自己需要的格式[dateFormatter setD

2015-06-13 09:20:27 419

转载 NSStringDrawingOptions

NSStringDrawingTruncatesLastVisibleLine:如果文本内容超出指定的矩形限制,文本将被截去并在最后一个字符后加上省略号。如果没有指定NSStringDrawingUsesLineFragmentOrigin选项,则该选项被忽略。NSStringDrawingUsesLineFragmentOrigin:绘制文本时使用 line fragement or

2015-06-11 17:01:17 569

原创 SDWebImage报错

报错:    Use of undeclared identifier '_executing';    Use of undeclared identifier '_finished';@synthesize executing = _executing ;  @synthesize finished = _finished;

2015-06-05 13:25:32 455

转载 NSURLRequestCachePolicy 缓存策略

1> NSURLRequestUseProtocolCachePolicy = 0, 默认的缓存策略, 如果缓存不存在,直接从服务端获取。如果缓存存在,会根据response中的Cache-Control字段判断下一步操作,如: Cache-Control字段为must-revalidata, 则询问服务端该数据是否有更新,无更新的话直接返回给用户缓存数据,若已更新,则请求服务端.2> NSU

2015-06-04 14:43:31 281

转载 github生成秘钥

在 mac 上使用 Git 和 GitHub 连接2011-11-22记得之前写过一篇 win 下面使用 Git 的文章,今天写下一篇在 mac 下面的。首先,需要在 mac 下安装 git.mac git 的地址: http://code.google.com/p/git-osx-installer/ 由于可能这个网址访问 不了,所以需要使用源码安装。

2015-05-20 00:32:58 894

转载 github的使用

提起github相信大家都不会陌生,在这里就不再赘述了。作为开源代码库以及版本控制系统,使用好了确实会非常受益,再说的势利点,你找工作时给面试官说你经常维护自己的技术博客和github,相信你给他的印象会好很多。     windows底下如何使用github,很多好心人都已经给了非常详细的解决方案,你只需问下度娘,她会帮你解决,这里对于windows底下的使用我也就不再赘述了。这里主

2015-05-20 00:32:24 296

转载 添加pch文件

http://www.cnblogs.com/YouXianMing/p/4042353.html#commentformXcode6中添加pch文件 1. 新建工程: 2. 创建pch文件: 3. 在setting里面进行设置:

2015-05-20 00:14:24 262

原创 app icon 需要哪些尺寸的图片

Device/Screen File Name (PNG) Icon Size (pixels) iPhone and iPod Application Icon for iPhone (retina display) [email protected] 114 x 114 Application Icon icon for iPhone Icon.png

2015-05-17 11:12:25 587

转载 OC代码编写规范

概要Objective-C 是一门面向对象的动态编程语言,主要用于编写 iOS 和 Mac 应用程序。关于 Objective-C 的编码规范,苹果和谷歌都已经有很好的总结:Apple Coding Guidelines for CocoaGoogle Objective-C Style Guide本文主要整合了对上述文档的翻译、作者自己的编程经验和

2015-05-16 22:47:10 1601

原创 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[YCFlag objectAtIn

检查数组下标是否正确

2015-05-16 17:13:43 398

原创 Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x687

1、打开xib文件,在File's Owner上点击右键,然后在弹出的窗口中检查是否有“惊叹号”提示的IBOutlet连接2、检查在xib文件中没有正确指定对象的类3、查看连线是否正确

2015-05-16 17:08:01 462

原创 xcode6中iphone模拟器的UDID

BE608556-84B4-42BB-99E7-0D8BEA6940DD  4s --->7.1761149D9-BA5D-40AB-AF29-58DEE80A8C66  4s--->8.200C6639B-DF7E-4766-8351-53A7B7F9F67E   4s---> 8.3A14AF8A3-B9F3-439C-920F-1F567DFCE125   5--->7.

2015-05-14 17:00:59 2645

原创 Xcode6文档注释下载地址

https://github.com/onevcat/VVDocumenter-Xcode

2015-05-06 18:01:00 304

原创 cell的detailLabel不显示

cell = [[UITableViewCellalloc] initWithStyle:UITableViewCellStyleSubtitlereuseIdentifier:ID];将cell的样式设为Subtitle

2015-05-06 08:34:49 380

原创 CUICatalog: Invalid asset name supplied: (null)、Unknown CGRect

1、UIImageView为空所致2、在Xcode6之前,创建的文件系统会自动为用户导入Foundation.h和UIKit.h文件,但是最新的Xcode6只为用户导入了Foundation.h文件,缺少一个。只需要导入 #import

2015-05-02 09:19:17 277

原创 UIImage 所支持的图片类型

2015-05-01 22:47:55 532

转载 加载图片使用imageNamed方法还是 imageWithContentsOfFile?

Apple官方的文档为生成一个UIImage对象提供了两种方法:1. imageNamed,其参数为图片的名字;2. imageWithContentsOfFile,其参数也是图片文件的路径。那么两种有什么区别吗?肯定是有的。根据Apple的官方文档:imageNamed: 这个方法用一个指定的名字在系统缓存中查找并返回一个图片对象如果它存在的话。如果缓

2015-05-01 22:22:41 357

原创 一个关于UIImage的错误:CUICatalog: Invalid asset name supplied: (null), or invalid scale factor: 2.000000

[UIImage imageNamed:name];但是这个name却是空的,所以就报了这个错了。解决方法,在项目中搜索[UIImage imageNamed:,然后打印看看所谓的name是否为空。找到后替换。

2015-05-01 21:16:17 360

原创 Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the desi

让自定义的storyboard成为主storyboard

2015-05-01 18:14:01 263

空空如也

空空如也

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

TA关注的人

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