readwrite:是可读可写的特性;需要生成getter和setter方法的时候用到; readonly:只读特性,只生成getter方法;不想在类外修改该属性的时候用到; assign:赋值特性,setter方法将传入参数赋值给实例变量;仅在设置变量时使用; retain:持有特性,setter ...
分类:
其他好文 时间:
2020-02-13 17:13:58
阅读次数:
75
错误原因: 集群服务器修改过一次IP,但是对应的/etc/hosts文件没有修改 错误日志 cat /var/log/mongdb/mongd.log 2019-01-16T09:50:44.675+0800 E STORAGE [initandlisten] Failed to set up li ...
分类:
数据库 时间:
2020-02-13 12:41:57
阅读次数:
235
运行代码: a=1 b=1 x=1 if a==b else x=0 print(x) 提示错误: File "test.py", line 3 x=a if a==b else x=0 ^ SyntaxError: can't assign to conditional expression ex ...
分类:
编程语言 时间:
2020-02-12 00:50:55
阅读次数:
97
pthread_rwlock:读写锁 #import "ViewController.h" #import <Pthread.h> @interface ViewController () @property (nonatomic,assign) pthread_rwlock_t lock; @en ...
分类:
移动开发 时间:
2020-02-12 00:26:51
阅读次数:
106
#import "ViewController.h" #import <libkern/OSAtomic.h> @interface ViewController () @property (nonatomic,assign) int ticket; //@property (nonatomic,a ...
分类:
移动开发 时间:
2020-02-08 00:44:13
阅读次数:
191
对象赋值 自定义对象方法 is()方法 assign ...
分类:
其他好文 时间:
2020-02-07 12:44:44
阅读次数:
66
剑指OFFER 复杂链表的复制 题目描述 输入一个复杂链表(每个节点中有节点值,以及两个指针,一个指向下一个节点,另一个特殊指针指向任意一个节点),返回结果为复制后复杂链表的head。(注意,输出结果中请不要返回参数中的节点引用,否则判题程序会直接返回空) 分析 设A为被复制的链表,B为复制成功的链 ...
分类:
其他好文 时间:
2020-02-06 14:46:38
阅读次数:
78
1、浅拷贝只是拷贝一层,更深层次对象级别的只拷贝引用(栈中的地址) 2、深拷贝拷贝多层,每一级别的数据都会拷贝 3、Object.assign(target,...source)(ES6新增的方法可以浅拷贝) 一、浅拷贝 1 var obj = { 2 name: 'Cindy', 3 age: 1 ...
分类:
其他好文 时间:
2020-02-06 14:22:03
阅读次数:
75
我的项目在mac上运行的很好,结果windows电脑,就一直报这个错误 解决方案: babel增加 @babel/plugin-transform-modules-commonjs 参考文章: https://www.cnblogs.com/dianzan/p/10676771.html 网上搜到的 ...
分类:
其他好文 时间:
2020-02-02 01:36:10
阅读次数:
78
vue-cli3打包时遇到Cannot assign to read only property 'exports' of object '#<Object>'问题的解决方法。 大致是说,在webpack打包的时候,可以在js文件中混用require和export。但是不能混用import 以及mo ...
分类:
其他好文 时间:
2020-01-31 12:16:14
阅读次数:
94