ios4 - Failing to add NSDate into NSDictionary -
ios4 - Failing to add NSDate into NSDictionary -
i trying addd nsdate nsdictionary.can tell me how add together it?
- (void)parser:(nsxmlparser *)parser didstartelement:(nsstring *)elementname namespaceuri:(nsstring *)namespaceuri qualifiedname:(nsstring *)qualifiedname attributes:(nsdictionary *)attributedict { //if(conditioncount ==0){ if( [@"forecast_information" isequaltostring:elementname] ) { //conditiondate = date nsdate *now=[nsdate date]; isparsinginformation=yes; nsarray *array=[nsarray arraywithobject:now]; nslog(@" time %@",array); [forecastconditions addobject:[nsmutabledictionary dictionary]]; } else if([@"forecast_date" isequaltostring:elementname]) { if(!forecast_information) forecast_information=[[nsmutablearray alloc]init]; } else if(isparsinginformation){ nsmutabledictionary *field=[forecastconditions lastobject]; [field setobject:[attributedict objectforkey:@"data"] forkey:elementname]; }
i dnt know..see want getting google weather api in nsdictionary named fields..i want add together nsdate scheme @ first index of nsdictionary..i nsdictionary couple of data,i want add together nsdate @ first index..i not able it. trying increment date each loop...how it?
i think date not data
[field setobject:[attributedict objectforkey:@"date"] forkey:elementname];
updated code
nsmutabledictionary *dic=[[nsmutabledictionary alloc] init];//creation [dic setobject:[nsdate date] forkey:@"today"];//added nslog(@"dic : %@ \n\n",dic);
ios4
Comments
Post a Comment