gpt4 book ai didi

ios - 应用程序在使用 Linphone 的 lpConfigStringForKey 上崩溃

转载 作者:行者123 更新时间:2023-11-29 05:36:30 24 4
gpt4 key购买 nike

我有一个使用 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

我想我在添加框架时丢失了一些东西,但我还没有找到它。

  • 注意 - 如果我注释掉 lp_config_get_string 调用,那么当应用程序到达下一个 lp_config 函数调用时,它会在那里崩溃。所以看起来它与 linphone.framework 和 lp_config 模块有关,但我还没有找到解决方案。

谢谢

最佳答案

我发现了这个问题。 init 函数中缺少以下内容:

    [self renameDefaultSettings];
[self copyDefaultSettings];
[self overrideDefaultSettings];

这导致 lp_config 出现一些问题

关于ios - 应用程序在使用 Linphone 的 lpConfigStringForKey 上崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56993398/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com