相关疑难解决方法(0)

在该过程中无法执行支持代码以读取Objective-C类数据。在真正的iPhone设备上

当在Simulator中调用此基于目标C的方法时,没关系。但是在真正的iPhone设备中,Thread 1: signal SIGABRT

warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available.

这是代码

+ (NSData *)aesDecrypt:(NSURL *)url :(NSString *)key {

NSData *data = [NSData dataWithContentsOfURL: url];
if (data == nil) {
    NSLog(@"file not found");
    return nil;
}

char keyPtr[kCCKeySizeAES128];
bzero(keyPtr, sizeof(keyPtr));

[key getCString:keyPtr maxLength:sizeof(keyPtr)];

size_t bufferSize = [data length] + kCCBlockSizeAES128;
size_t decryptedBytesSize = 0;

void *buffer = malloc(bufferSize);

CCCryptorStatus result = CCCrypt(kCCDecrypt, kCCAlgorithmAES128, …
Run Code Online (Sandbox Code Playgroud)

iphone ios

11
推荐指数
2
解决办法
1万
查看次数

JSON 解码器类型不匹配错误

我想使用 decodeable 解析 JSON,但我得到一个错误类型不匹配,例如:

Swift.DecodingError.Context(codingPath: [], debugDescription: "预期解码数组,但找到了字典。"

我的 JSON :

{
  "code": 0,
  "data": {
    "_id": "string",
    "title": "string",
    "images": [
      "string"
    ],
    "shortDesc": "string",
    "desc": "string",
    "price": 0,
    "discountPrice": 0,
    "quantity": 0,
    "category": {
      "name": "string",
      "val": "string"
    },
    "brand": {
      "name": "string",
      "val": "string"
    },
    "variants": [
      {
        "name": "string",
        "value": "string",
        "quantity": 0,
        "variantCode": "string"
      }
    ],
    "stockCode": "string",
    "updatedDate": "2018-06-05T14:04:51.226Z",
    "status": true,
    "isDeleted": true,
    "isNew": true,
    "freeCargo": true,
    "createDate": "2018-06-05T14:04:51.226Z",
    "note1": "string",
    "note2": "string",
    "note3": …
Run Code Online (Sandbox Code Playgroud)

parsing json decoder ios swift

1
推荐指数
1
解决办法
1836
查看次数

标签 统计

ios ×2

decoder ×1

iphone ×1

json ×1

parsing ×1

swift ×1