Skip to content

[SR-6731] PropertyListDecoder unable to decode __NSCFType #3748

@krzyzanowskim

Description

@krzyzanowskim
Previous ID SR-6731
Radar None
Original Reporter @krzyzanowskim
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee None
Priority Medium

md5: 243c24973c4c93e917da850b1907c06d

Issue Description:

The plist file can store NSObject aka AnyObject aka Any aka CFTypeRef aka NSCFType and SwiftFoundation NSKeyedArchiver can read those.

The PropertyListSerialization is able to handle that too. YET, there is no way to decode this value using Decodable and PropertyListDecoder.

error is: eg. "Expected to decode Data but found __NSCFType instead."

I wonder if is it possible to (any)

  1. bitcast those to Any

  2. treat as raw bytes (return Data)

anything is better than throw error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions