SKTextureAtlas +atlasWithDictionary: often crashes with UIImage dictionary keys

Originator:m.j.konieczny
Number:rdar://19366493 Date Originated:2015-01-02
Status:Open Resolved:
Product:iOS SDK Product Version:8.1
Classification:Crash Reproducible:
 
Sample project and crash log: https://github.com/narfdotpl/radar-19366493


## Description

SKTextureAtlas +atlasWithDictionary: often crashes on iOS 8.1 (I didn't try other versions) when UIImage instances are used as dictionary keys.


## Steps to Reproduce

1. Create a new project in Xcode for a universal Objective-C SpriteKit game.

2. Create an UIImage and a SKTextureAtlas in -didMoveToView: method:

    UIGraphicsBeginImageContextWithOptions((CGSize){ 100, 100 }, false, 0);
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    [SKTextureAtlas atlasWithDictionary:@{
        @"foo": image,
    }];

3. Run the app in a simulator or on a device.

4. Observe it crash on most occasions.

Comments

Duplicate of 19290485 (Open)

Today it was marked as a duplicate of radar 19290485 (Open).

By m.j.konieczny at March 28, 2015, 3:49 p.m. (reply...)

Sorry, I meant "values", not "keys".

By m.j.konieczny at Jan. 2, 2015, 3:09 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!