摘要: 由alloc、copy、new、mutableCopy修饰的对象都会使引用计数值加一 release:释放对象 release = 0时,废弃对象 (1)带有alloc/new/copy/mutableCopy关键字,是自己生成对象并持有,自己持有的对象,自己得释放(release) (2)取得任何 阅读全文
posted @ 2017-11-24 13:42 温水青蛙。 阅读(110) 评论(0) 推荐(0) 编辑
摘要: void *objectISA = (JK_EXPECT_F(workAroundMacOSXABIBreakingBug)) ? NULL : *((void **)objectPtr); 好久没启动的项目突然崩在了JSONKit.m中的2599这一行,只给出了EXC_BAD_ACCESS这样的信 阅读全文
posted @ 2017-11-16 11:36 温水青蛙。 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 一、通过Pods添加的jsonKit,编译后会出现20个关于‘isa’指针的错误,原因是这种isa的方法已经被废弃了。 解决的方法有两种: (1)定位到出错的jsonKit代码中,根据系统提示fix修复,或者是手动修改成object_setClass的形式,这种比较麻烦,需要一个个的修改。 (2)点 阅读全文
posted @ 2017-11-16 10:04 温水青蛙。 阅读(479) 评论(0) 推荐(0) 编辑
摘要: 当[UIImage imageNamed:imageName] 中 的imageName为空时,系统会打印出:CUICatalog: Invalid asset name supplied: 这种信息,这是因为UIImage加载的图片名称是无效的,imageName不能是空值。 如果想实现在点击一个 阅读全文
posted @ 2017-11-10 17:25 温水青蛙。 阅读(430) 评论(0) 推荐(0) 编辑
摘要: cocoapods 安装 查看cocoapods 源: gem sources -l 1、删除已安装的源 gem sources —remove https://rubygems.org/ 2、添加安装包的源 gem sources --a https://ruby.taobao.org/ 3、安装 阅读全文
posted @ 2017-11-10 15:00 温水青蛙。 阅读(192) 评论(0) 推荐(0) 编辑
摘要: xcode 报错: failed to find PDF header: `%PDF' not found. /* com.apple.actool.errors */ : error: Failed to read file attributes for "/Users/admin/Desktop 阅读全文
posted @ 2017-11-10 15:00 温水青蛙。 阅读(1644) 评论(0) 推荐(0) 编辑
摘要: 文字高度的适配 一、单行适配, 根据字体得到NSString的尺寸 CGSize size = [firstStr sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:fnt,NSFontAttributeName,nil]]; 阅读全文
posted @ 2017-11-10 14:59 温水青蛙。 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 某一页面强制横屏: 一、首先 在项目里面设置Device Orientation允许转屏的方向,下面设置了竖屏,和横屏(横屏左右根据home键确定): 二、AppDelagate代码 AppDelagate.h文件 @property (nonatomic,assign)BOOL allowRota 阅读全文
posted @ 2017-11-10 14:58 温水青蛙。 阅读(312) 评论(0) 推荐(0) 编辑
摘要: 检测手机的屏幕方向: 一、在需要检测的页面里的ViewDidLoad方法里注册通知: [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCen 阅读全文
posted @ 2017-11-10 14:57 温水青蛙。 阅读(603) 评论(0) 推荐(0) 编辑
摘要: 处理接口里不支持的转义特殊字符: NSCharacterSet *URLCombinedCharacterSet = [[NSCharacterSet characterSetWithCharactersInString:@"\"#%/,:<>?@[\\]^`{|}"]invertedSet]; N 阅读全文
posted @ 2017-11-10 14:56 温水青蛙。 阅读(319) 评论(0) 推荐(0) 编辑