第一个iOS app开发过程及问题记录

1、真机调试中遇到 the file couldn't be opened because you don't have permission to view it

解决:

http://www.cnblogs.com/gaox97329498/p/4734917.html

2、目标为真机,编译成功后 could not launch "x": Verify the Developer App certificate for your account is trusted on your device...

解决:

iphone上,IOS10.2.1,通用-设备管理-开发者应用-信任开发者-验证应用

3、编译到真机时,报错 you session has expired. Please log in. No profiles for 'name' were found ... 一类问题

项目Identity和signing配置:

确保ios账户必须登录,在xcode-prefrences中查看

bundle identifier必须唯一,然后signing登录后,会生成一个关联账户的siging certificate

4、The maximum number of apps for free development profiles has been reached.

https://www.jianshu.com/p/99c441070b22 

5、IOS项目中的常见文件 

 https://www.jianshu.com/p/f458fba04db0

6、IOS目录解析 

https://www.jianshu.com/p/3a220489a27b 

7、IOS应用程序结构

https://www.cnblogs.com/ai-developers/p/4507766.html

8、storyboard使用

https://blog.csdn.net/yuchu1900/article/details/80616372

https://blog.csdn.net/yuchu1900/article/details/80628178

https://blog.csdn.net/yuchu1900/article/details/80657781

Navigation Controller

https://blog.csdn.net/chy555chy/article/details/51692279

https://blog.csdn.net/nextstudio/article/details/42120017

9、IOS项目改名

https://www.jianshu.com/p/2887d6fb5769 

 10、布局 autolayout 、autoresizing

 https://www.jianshu.com/p/b637d3d21606

11、禁止横屏

https://www.jianshu.com/p/5f5d46e674a7

12、包含文件和库文件路径

https://blog.csdn.net/llq108/article/details/73551190

13、targets和project

相当于VS项目和解决方案

https://www.jianshu.com/p/e304247ede59

14、opencv配置及swift和oc c++使用

使用oc作bridge。添加Cocoa Touch Class文件----选objc语言----选择创建Bridging Header文件----在bridge header文件中import oc头文件----将oc的m文件改为mm----oc的头文件和源码文件@接口中定义c++接口

https://www.jianshu.com/p/88a6d06b670b

15、swift的 @IBoutlet 和 @IBAction

https://www.jianshu.com/p/50db0e59820e

16、UICollectionView

https://blog.csdn.net/fengzhixinfei/article/details/77450205

17、tableview静态cell

https://www.jianshu.com/p/2c3de1990eb2

18、swift调用oc c++

https://www.jianshu.com/p/4f5413c8caa0

19、oc UIstoryboard获取scene

https://www.cnblogs.com/ruiati/p/4323871.html

在代码中加载storyBoard中的ViewController

https://www.cnblogs.com/mafeng/p/5800253.html

20、获取xib或者storyboard中控件

https://blog.csdn.net/qq_15139603/article/details/52910046

21、viewDidload viewDidUnload viewWillapper viewWilldisapper

https://blog.csdn.net/ljw04040426/article/details/12234443

22、获取控件相对屏幕的坐标位置

https://blog.csdn.net/bitcser/article/details/53995184

23、ios 获取导航栏和状态栏高度

http://www.cocoachina.com/ios/20180308/22505.html

24、实现弹出视图popview

https://blog.csdn.net/findhappy117/article/details/79341819

https://www.cnblogs.com/cnman/p/4986607.html

这个比较直接:

https://www.jianshu.com/p/c3a5c0db0950

25、UIImageView使用

https://www.cnblogs.com/iOS-mt/p/4131991.html

26、UIView的alpha、hidden和opaque属性之间的关系和区别

https://blog.csdn.net/wzzvictory/article/details/10076323

27、网络编程NSURLSession的基本使用

https://www.cnblogs.com/goodboy-heyang/p/5193960.html

28、HTTP、POST/GET请求、发送JSON

https://www.cnblogs.com/LDSmallCat/p/4942039.html

29、官方JSON api NSJSONSerialization等使用

https://www.cnblogs.com/wqxlcdymqc/p/3229705.html

30、utf8编码解码 NSUTF8StringEncoding

https://www.jianshu.com/p/ccdb6b220ac4

31、网络编程NSURLSessionConfiguration会话配置

https://www.cnblogs.com/liugengqun/p/5140296.html

https://blog.csdn.net/growinggiant/article/details/50483127

在我的应用场景发现使用[NSURLSessionConfiguration defaultSessionConfiguration],HTTPAdditionalHeaders配置没有用。

而是用NSMutableURLRequest的allHTTPHeaderFields属性配置http header才生效的

32、NSString长度length

https://blog.csdn.net/leinchu/article/details/38539019

https://www.cnblogs.com/max5945/archive/2012/07/24/2606957.html

33、导航栏设置NavigationBar,navigationItem

https://blog.csdn.net/sinat_31416251/article/details/49182929

https://blog.csdn.net/feosun/article/details/72857316

https://www.jianshu.com/p/74ea3d2055c6

34、storyboard设置按钮圆角

https://blog.csdn.net/ssrrxx111/article/details/45367767

35、UIView 坐标frame、bounds跟center属性

https://www.cnblogs.com/hj2xx2hj/p/4918611.html

36、UILabel 使用

https://www.cnblogs.com/chixuedong/p/5235347.html

37、协议和代理、使用代理进行回调

协议、代理概念:

https://blog.csdn.net/u012078168/article/details/72871334

https://blog.csdn.net/wakice/article/details/78172520

使用协议实现回调:

https://blog.csdn.net/qq_37656219/article/details/79874427

总结就是:

①定义一个协议protocol,并定义其中的方法func

②在类B声明中添加该协议的属性m_delegate,也就是代理。

③在类B需要回调的地方,调用该协议回调方法[self.m_delegate func]

④在类A声明中声明类A遵循协议protocol,@interface A() <protocol1,protocol2...>

⑤在类A实现中,实现协议protocol的方法func

⑥在类A中实例化B后,声明A为实例b的该协议代理,self.b_instance.m_delegate = self

⑦实现回调:当类B运行到回调方法处,回调A中的方法

38、主线程、主队列

开发时遇到执行完一个耗时动作后,UI的操作没有响应,包括模拟点击事件,直接点击倒是有反应。怀疑是优先级问题。网上查找发现IOS有主队列和主进程等。具体是不是opencv造成的未知。直接找解决办法:

尝试:https://www.jianshu.com/p/0dcd982a1f0a

用[NSThread isMainThread]判断发现是运行在主进程了,但是仍然在一段事件之后才响应,估计仍然是没加在队列最前端,不深究。

后来参考:

https://blog.csdn.net/my_programe_life/article/details/49703339

发现直接dispatch_async(dispatch_get_main_queue(), ^{...}可以查在队列最前面直接执行。

39、NSTimer使用详解-开启、关闭、移除

https://blog.csdn.net/zyzxrj/article/details/41842593

40、代码发送按钮点击事件sendActionsForControlEvents

https://www.jianshu.com/p/97b7cb7f6278

https://www.jianshu.com/p/c554b834c2a1

使用发现虽然能发送点击事件,但是在任务队列里并不是第一优先级,而且默认也不在主进程里面。

41、tableView collectionView 响应点击事件

自带API方法:

https://www.cnblogs.com/hero11223/p/7986178.html

https://www.xuebuyuan.com/3187513.html

42、代码添加按钮

https://www.cnblogs.com/jiwangbujiu/p/5332505.html

43、UIImageView添加响应点击事件

https://blog.csdn.net/thanklife/article/details/77599057

猜你喜欢

转载自blog.csdn.net/fantasysolo/article/details/88035530