我保持NSMutableDictionary
pair.Now我需要爲每個it.How值從字典retrive值執行一些操作保持鍵和值。如何獲取Objective-C中字典中每個鍵的值?
// this is NSMutableDIctionary
NSMutableDictionary *dictobj = [[NSMutableDictionary alloc]init];
// in methodA
-(void)methodA
{
//get the value for each key and peform an operation on it.
}
如何進行? plz幫助
wher是CurrentValue的聲明?其中的類對象是什麼? – suse 2010-02-18 04:04:23
這是一個利用「快速列舉」(就像其他的答案)的。 'currentValue'在for-in循環中聲明爲正確。 – andyvn22 2010-02-18 04:13:22