2013-10-08 22 views
0

我有這段代碼將解析圖像到我的OSX應用程序。OSX解析 - 如何獲得背景圖片

// give our representation to the image browser 
- (id)imageRepresentation { 
    NSLog(@"%s", __FUNCTION__); 
    return [_file getData]; 
} 

這工作,但結果:

Warning: A long-running Parse operation is being executed on the main thread. 
Break on warnParseOperationOnMainThread() to debug. 

我需要的[_file getData]方法移動到後臺線程,並可以使用一些幫助。

回答

0

錯誤信息您收到 -

Warning: A long-running Parse operation is being executed on the main thread. Break on warnParseOperationOnMainThread() to debug.

運行的是異步查詢時,只是警告而已。更多信息可以在here找到。

如果要在後臺運行查詢,請使用PFQuery類的findObjectsInBackgroundWithBlock:方法。

+0

謝謝埃裏克。與IKImageBrowser數據源一起使用時,我遇到了在後臺運行語法時遇到的問題 - 與[_file getData]等效。 –

+0

我不完全確定你的意思 - 如果你已經檢索了一個對象,那麼調用'getData'就不應該運行另一個查詢。我建議看看這裏的查詢文檔:https://www.parse.com/docs/ios_guide#queries/iOS –