10
Finora ho questo codice:Swift - La conversione di un valore di <AnyObject?> AutoreleasingUnsafeMutablePointer
var thumbnailErr: NSError?
var thumbnailDictionary: AutoreleasingUnsafeMutablePointer<AnyObject?> = nil
let getItemSucceeded = url.getPromisedItemResourceValue(thumbnailDictionary, forKey: NSURLThumbnailDictionaryKey, error: &thumbnailErr)
if getItemSucceeded {
}
Ora voglio trasformare thumbnailDictionary in un dizionario o NSDictionary. Questo è come lo faccio in Objective-C:
BOOL thumbnailSucceeded = [urlFromPath getPromisedItemResourceValue:thumbnailDictionary forKey:NSURLThumbnailDictionaryKey error:&thumbnailErr];
if (thumbnailSucceeded) {
NSDictionary *dict = (__bridge NSDictionary *)(void *)thumbnailDictionary;
}
non posso per la vita di me capire come fare questo a Swift. Aiuto?
Grazie per aver risposto alla tua domanda. Lo odio quando trovo un post con la domanda esatta che ho, solo che il proprietario pubblichi "capito, non importa" senza spiegare la loro soluzione – Alexander