工作中经常会遇到一些Bug,时间长了有时候就忘记了,这样不好. 特地在这加一个随笔,把以后出现的有价值一点的bug记录在这里,提醒自己,也可以给刚入门的同学一些参考,避免这些坑. 1:界面已经销毁,代理回调会导致崩溃的bug 场景: A Push to B 在B中发送了一个异步请求,请求完成之后执行 if(self.delegate && [self.delegate respondsToSelector:@selector(requestMessageFinish:)]) { [self…
一.具体情况区分 对于简单类型变量,是无法直接获得变量类型的:要想获取,必须自定义函数进行返回. 对于包装类型变量,是可以直接获得的,变量名称.getClass().getName(); 二.代码实现 public class JavaGetVariableDataType { public static void main(String[] args) { int i = 1; //i的数据类型为int System.out.println(getVariableDataType(i));…
1.TypeError: 'int' object is not iterable: 场景示例: data = 7 for i in data: print(i) # 原因:直接对int数据进行迭代造成的,修改为: for i range(data): print(i) 2.TypeError: 'list' object is not callable 场景示例: data= [2,3,4,5,6] for index,item in enumerate(data): print(data(i…