I receive a JSON object (converted to NSDictionary) which I want to put it into my model object.
i tried this one
{
Description = "Desc.";
EndTime = "2014-06-25T05:35:00";
Id = "";
IsActive = 1;
StartTime = "2014-06-25T05:30:00";
Title = "Test appointment";
},
{
Description = Qww;
EndTime = "2014-06-26T02:58:00";
Id = "";
IsActive = 1;
StartTime = "2014-06-26T01:58:00";
Title = q;
}
I want to store it into my model object NSobject. but only get first dictioanry
i have tried this one
MyAppoinmentModel * modelObj;
modelObj =[[MyAppoinmentModel alloc]init];
modelobj =[[MyAppoinmentModel alloc]init];
for(NSMutableDictionary * dic in array)
{
NSString * strTitle =[dic valueForKey:@"Title"];
NSString * strDescription =[dic valueForKey:@"Description"];
NSString * strStartTime =[dic valueForKey:@"StartTime"];
NSString * strEndTime =[dic valueForKey:@"EndTime"];
NSString * strMeetingDate =[dic valueForKey:@"MeetingDate"];
NSString * strIsActive =[dic valueForKey:@"IsActive"];
modelobj.Titlestr=strTitle;
modelobj.Descriptionstr=strDescription;
modelobj.StartTimeStr=strStartTime;
modelobj.EndTimeStr=strEndTime;
modelobj.Daystr=strMeetingDate;
}
Where may i wrong can u help me to do this one.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…