2014-08-28 28 views
10

到目前爲止,我有這樣的代碼:斯威夫特 - 轉換的AutoreleasingUnsafeMutablePointer <AnyObject?>價值

var thumbnailErr: NSError? 
var thumbnailDictionary: AutoreleasingUnsafeMutablePointer<AnyObject?> = nil 
let getItemSucceeded = url.getPromisedItemResourceValue(thumbnailDictionary, forKey: NSURLThumbnailDictionaryKey, error: &thumbnailErr) 
if getItemSucceeded { 

} 

現在我想轉thumbnailDictionary到字典或NSDictionary中。這就是我如何在Objective-C中做到這一點:

BOOL thumbnailSucceeded = [urlFromPath getPromisedItemResourceValue:thumbnailDictionary forKey:NSURLThumbnailDictionaryKey error:&thumbnailErr]; 
if (thumbnailSucceeded) { 
    NSDictionary *dict = (__bridge NSDictionary *)(void *)thumbnailDictionary; 
} 

我不能爲我的生活弄清楚如何在Swift中做到這一點。幫幫我?

回答

20

明白了。傳遞AutoreleasingUnsafeMutablePointer是沒有必要的。

​​
+5

謝謝你回答你自己的問題。我討厭它,當我找到一個具有我確切問題的帖子時,只有擁有者在沒有解釋他們的解決方案的情況下發布「明白了,沒關係」 – Alexander 2016-05-11 22:11:50