一.关于字符串为空的判断
在打印信息中看到值为null 于是用了isEqual:[NSNull null]
没效果.
猜测可能是字符串null? 于是用了isEqualToString:@"null"
然而还是没有卵用 于是断点看了下是nil nickName == nil
OK了,但最后觉得其实nickName.length == 0
更好点,因为不管是null还是nil,length总归 都是等于0的。
二. 关于一个方法里面的char数组
本来在方法中定义的一个char数组 结果没跑多久就内存暴涨挂掉了
char rgbaBuf[Width_Video*Height_Video\*4];
后面把这个搞成全局的就OK了
三.构建版本时遇到的问题

把version 改为1.0.0 然后重写archive submit就好了
三.button没反应 点击界面会打印
unexpected nil window in _UIApplicationHandleEventFromQueueEvent, _windowServerHitTestWindow: <UIWindow: 0x78e58ef0; frame = (0 0; 0 0); gestureRecognizers = <NSArray: 0x78e5b280>; layer = <UIWindowLayer: 0x78e59100>>
解决:
self.window = [[UIWindow alloc]init];
改为
self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
是因为window没有frame
四. 今天做一个demo 有个模型类首字母没大写于是

才知道类名首字母大写不仅仅是规范···
五. 关于 self.peripheral = peripheral;里面值的问题
整整一个下午排除这个bug 之前监听和写入的失败 就是因为 我想当然的以为在didConnectPeripheral的时候self.peripheral = peripheral;已经拿到了全部的特征和服务 其实 是一直才查询完服务和特征的代理走完 才拿到全部的服务和特征值
六.关于数组里面一直没拿到值

七.关于父类子类之间转换的问题
父类强转子类 需要使用子类来初始化 否则无法强转
子类可以强转父类
八.ld: warning: directory not found for option '-F/Users/XX
删除target 和 tests的Framework Search Paths的目录 把库文件删除引用重新添加

九.code signing is required for product type 'Application' in SDK 'iOS 9.0
解决:选择工程->Build Settings -> Code Signing -> Code Signing Identity -> Debug -> Any ios SDK 将选项改为:iOS Developer
十.-fembed-bitcode is not supported on versions of iOS prior to 6.0
解决:在Build Settings里面搜索Bitcode 将Enable Bitcode设置为 NO 就可以了
网友评论