gpt4 book ai didi

ios - 创建 BoxMetadata 时出现意外值

转载 作者:行者123 更新时间:2023-11-29 01:29:58 26 4
gpt4 key购买 nike

我的 iOS 应用程序正在通过 BOXContentSDK 访问 BOX API。突然,我在创建 BOXMetadata 时收到了“版本”和“typeversion”的意外类型(int),由于下面的 NSJSONSerialization+BOXAdditions.m 断言导致崩溃

+ (id)box_ensureObjectForKey:(NSString *)key inDictionary:(NSDictionary *)dictionary hasExpectedType:(Class)cls nullAllowed:(BOOL)nullAllowed
{
id object = [dictionary objectForKey:key];
id extractedObject = object;
if ([object isEqual:[NSNull null]])
{
if (nullAllowed)
{
extractedObject = [NSNull null];
}
else
{
BOXAssertFail(@"Unexpected JSON null when extracting key %@ from dictionary %@", key, dictionary);
extractedObject = nil;
}
}
else if (object == nil)
{
extractedObject = nil;
}
else if (![object isKindOfClass:cls])
{
BOXAssertFail(@"Unexpected type when extracting key %@ from dictionary %@\nExpected type %@ but instead got %@", key, dictionary, NSStringFromClass(cls), NSStringFromClass([object class]));
extractedObject = nil;
}
return extractedObject;
}

这是我从上面的断言中得到的异常;

Expected type NSString but instead got __NSCFNumber'

下面的示例响应 JSON;

{"documenttype":"Inspections","categories":"Inspections","reportdocumenttype":"","documentTag":"SR000070022803","csa.internal.only":"false","$type":"properties","$parent":"file_42748776033","$id":"314f1a71-7ecf-4e6f-a765-8a6eaefed6d3","$version":0,"$typeVersion":0,"$template":"properties","$scope":"global"}

谢谢!

最佳答案

感谢您与我们联系,Alp。我们的元数据 SDK 代码与值不再需要是字符串(元数据中可以有整数和浮点值)的事实不同步。这是您将在https://github.com/box/box-ios-sdk/pull/134中看到的主要变化。 ,其中包含针对此问题的修复。

如果您遇到其他问题,请告诉我们。

祝你好运,汤姆

关于ios - 创建 BoxMetadata 时出现意外值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33550632/

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