- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个使用 Linphone 库的 iOS VoIP 应用程序。以前该应用程序运行成功,但我刚刚升级了 linphone 框架和文件:LinphoneManager.h/.m 和 Utils.h/.m 从 linphone-iphone .
从新版本的 linphone-sdk 添加更新的框架并更新 LinphoneManager.h/m 后,我在应用程序启动时遇到崩溃。一旦应用程序点击
,就会发生崩溃lp_config_get_string(_configDb, [section UTF8String], [key UTF8String], NULL);
在 lpConfigStringForKey() 中。
我尝试删除和读取框架并检查 LinphoneManager.h/.m 代码,但我没有遇到解决方案,也没有在 linphone-iphone 问题中找到任何与我类似的实例。
当遇到以下代码块时发生崩溃
- (NSString *)lpConfigStringForKey:(NSString *)key inSection:(NSString *)section withDefault:(NSString *)defaultValue {
if (!key) {
return defaultValue;
}
const char *value = lp_config_get_string(_configDb, [section UTF8String], [key UTF8String], NULL);
return value ? [NSString stringWithUTF8String:value] : defaultValue;
}
这是 LinphoneManager.m 中的标准函数,我没有修改过。
具体来说,崩溃来自linphone框架中的这个函数:
lp_config_get_string(_configDb, [section UTF8String], [key UTF8String], NULL);
当应用程序崩溃时,我已经记录了 key、section 和 defaultValue 变量。他们是:
2019-07-11 10:58:51.033849-0500 myApp[15512:511705] KEY: debugenable_preference
2019-07-11 10:58:51.033964-0500 myApp[15512:511705] SECTION: app
2019-07-11 10:58:51.034040-0500 myApp[15512:511705] DEFAULT: (null)
lp_config_get_string 所指向的 linphone_config_get_string 的 header 注释如下:
/**
* Retrieves a configuration item as a string, given its section, key, and default value.
*
* The default value string is returned if the config item isn't found.
**/
LINPHONE_PUBLIC const char *linphone_config_get_string(const LinphoneConfig *lpconfig, const char *section, const char *key, const char *default_string);
这是错误和崩溃的屏幕截图: Crash stack trace and error
我想我在添加框架时丢失了一些东西,但我还没有找到它。
谢谢
最佳答案
我发现了这个问题。 init 函数中缺少以下内容:
[self renameDefaultSettings];
[self copyDefaultSettings];
[self overrideDefaultSettings];
这导致 lp_config 出现一些问题
关于ios - 应用程序在使用 Linphone 的 lpConfigStringForKey 上崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56993398/
我有一个使用 Linphone 库的 iOS VoIP 应用程序。以前该应用程序运行成功,但我刚刚升级了 linphone 框架和文件:LinphoneManager.h/.m 和 Utils.h/.
我是一名优秀的程序员,十分优秀!