Uploaded image for project: 'Swift'
  1. Swift
  2. SR-6731

PropertyListDecoder unable to decode __NSCFType

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Foundation
    • Labels:
      None

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              krzyzanowskim Marcin Krzyzanowski
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: