2013-03-04 32 views
0

我有一個對象 - NSObject,從NSDictionary的分配已結構爲:如何NSObject的分配到的UILabel

{ 
    author = "abc"; 
    content = "xyz"; 
    img = "1.gif"; 
    title = "bla bla" 
} 

所以我改變DetailViewController,如何分配價值 - >UILabel,我分配 假設

DetailViewController.h, @property(strong,nonatomic)UILabel * bookTitle;

如何分配字段標題củaNSObject - > bookTitle?

+1

我不明白。請澄清。 – trojanfoe 2013-03-04 15:52:48

+0

你只是在尋找bookTitle.text = <變量名> .title? – 2013-03-04 15:53:52

+0

對不起我的英語如此糟糕:(這意味着 我想要在DetailViewController中將NSObject(具有struct -json)賦值給UILabel – Giang 2013-03-04 15:54:14

回答

2

這樣做:

controller.bookTitle = data[@"title"]; 

其中controller是您DetailViewControllerdata一提的是在NSDictionary與數據的參考。

+0

感謝每一個,這麼多^^ – Giang 2013-03-05 01:21:57

相關問題