NSDictionary *topic = [spaces objectAtIndex:i];
NSInteger topicid = [topic valueForKey:@"TOPICID"];
當我運行這一點,並打印出的話題,我得到以下:valueForKey只返回內存地址,而不是實際價值
Printing description of topic:
<CFDictionary 0xdb2a70 [0x30307a00]>{type = mutable, count = 2, capacity = 12, pairs = (
10 : <CFString 0xdb5300 [0x30307a00]>{contents = "TOPICID"} = 29
12 : <CFString 0xdb53a0 [0x30307a00]>{contents = "TOPICNAME"} = <CFString 0xdb5360 [0x30307a00]>{contents = "zzzzzzzz"}
)}
然而,當我在看topicid,該值始終是一個內存地址。我究竟做錯了什麼?
你可以發表你如何在空間中設置對象的代碼? – pxl 2009-10-15 16:34:31