iOS开发时遇到的问题

1.数据库加密之Xcode9.0后,sqlcipher加密:Implicit declaration of function ’sqlite3_key‘is invalid in C99问题

解决办法

修改链接路径,使其引用自正确的文件

既然是链接文件出错,那么我们通过修改#import < sqlite3.h > 改为#import < SQLCipher/sqlite3.h > ,让其链接到sqlcipher下的sqlite3.h文件,可以解决这个问题

注意,如果像我们上一篇文章,是通过静态库来配置SQLCipher,是找不到< SQLCipher/sqlite3.h>路径的,我们可以通过强制打破隐式声明的方式解决这个问题,在FMDatabase.m中声明sqlite3_key和sqlite3_rekey:

#if defined(SQLITE_HAS_CODEC)
SQLITE_API int sqlite3_key(sqlite3 *db, const void *pKey, int nKey);
SQLITE_API int sqlite3_rekey(sqlite3 *db, const void *pKey, int nKey);
#endif

2.charles开启Charles-Proxy-macOS Proxy 时报错

Charles cannot configure your proxy settings while it is on a read-only volume. Perhaps you are running Charles from the disk image? If so, please copy Charles to the Applications folder and run it again. Otherwise please ensure that Charles is writable by the current user and try again.
解决:

终端输入后重启

sudo chown -R root "/Applications/Charles.app/Contents/Resources"
sudo chmod -R u+s "/Applications/Charles.app/Contents/Resources"

你可能感兴趣的:(iOS开发时遇到的问题)