2011-11-11 109 views
0

我使用RestKit與對象映射。這將運行asyncronus,並在接收到來自服務器的數據後更新對象。如果屬性更改調用委託方法

的一點是,我需要告知對象的屬性發生變化的另一個類。

現在,我遇到了一個錯誤:

bool _WebTryThreadLock(bool), 0x1ae420: Tried to obtain the web 
lock from a thread other than the main thread or the web thread. 
This may be a result of calling to UIKit from a secondary thread. Crashing now... 

我試圖改寫爲屬性的setter,但它看起來像屬性在另一個線程,而不是主線程設置。打電話給代表不起作用。

我能做些什麼來解決這個問題?

任何幫助表示讚賞!

回答

1

也許你需要發送的消息是這樣的:

[OBJ performSelectorOnMainThread:@selector(方法)

+0

的感謝!需要在我的對象的setter方法中使用'[delegate performSelectorOnMainThread:@selector(method)];''。 – MadMaxAPP