"paused" property does not successfully decode in SKNode

Originator:offbyfour
Number:rdar://25804711 Date Originated:4/19/2016
Status:Closed Resolved:8/2/2017
Product:iOS SDK Product Version:iOS 9.3 [1EE230]
Classification:Other Bug Reproducible:Always
 
Summary:
Using SpriteKit and NSKeyedArchiver.

An SKNode encoded with the paused property set to YES will decode with the paused property set to NO.

Note that the archive file shows that a property "_paused" is, in fact, encoded with a boolean YES value.  Nevertheless, the node decodes with paused property NO.

Steps to Reproduce:
Code to reproduce:

    SKNode *encodeNode = [SKNode node];
    encodeNode.paused = YES;
  
    NSString *filePath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]
                          stringByAppendingPathComponent:@"test.archive"];
  
    [NSKeyedArchiver archiveRootObject:encodeNode toFile:filePath];
  
    SKNode *decodeNode = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath];
    NSLog(@"decoded node has paused property %d", decodeNode.paused);


Expected Results:
Log should indicate that decoded node is paused.

    2016-04-19 11:17:22.375 HLEncodePause[60835:1297481] decoded node has paused property 1


Actual Results:
Log indicates that decoded node is not paused.

    2016-04-19 11:17:22.375 HLEncodePause[60835:1297481] decoded node has paused property 0

Comments

Verified fixed in iOS 11 beta 4 (15A5327g).

By offbyfour at Aug. 3, 2017, 5:18 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!