Friday 15 August 2014

ios - Unable to View the data in my UITableView -



ios - Unable to View the data in my UITableView -

i unable view info in uitableview, had 4 labels in uitableviewcell, trying info web-service. used work fine before upgrading ios 8, app not able display info after working in ios 8. other thing need specify is, when insert info web browser, able see record in app in uitableview, when insert info using app, not able display record. found there no issue web-service , database. because able see info when come in info in url. here below code :

nshttpurlresponse *response = nil; nsdata *urldata=[nsurlconnection sendsynchronousrequest:request returningresponse:&response error:&error]; nsurlrequest *urlrequest = [nsurlrequest requestwithurl:url cachepolicy:nsurlrequestreturncachedataelseload timeoutinterval:30]; // create synchronous request urldata = [nsurlconnection sendsynchronousrequest:urlrequest returningresponse:&response error:&error]; if ([response statuscode] >= 200 && [response statuscode] < 300) { nsstring *responsedatatest = [nsjsonserialization jsonobjectwithdata:urldata options:nsjsonreadingallowfragments error:&error]; nslog(@"responsedatatest : %@",responsedatatest); nsarray *entries = [nsjsonserialization jsonobjectwithdata:[responsedatatest datausingencoding:nsutf8stringencoding] options:0 error:&error]; nslog(@"entries : %@", entries); if(!entries) { nslog(@"error : %@", error); } else{ (nsdictionary *entry in entries) { projectnames = [entries valueforkey:@"nm_project"]; tasknames = [entries valueforkey:@"task_name"]; subtasknames = [entries valueforkey:@"subtask_name"]; timesheetid = [entries valueforkey:@"id_timesheet_dtls"]; projid = [entries valueforkey:@"id_project"]; taskid = [entries valueforkey:@"id_task"]; subtaskid = [entries valueforkey:@"id_sub_task"]; totalhours = [entries valueforkey:@"no_hours"]; approve = [entries valueforkey:@"fl_approve"]; leaves = [entries valueforkey:@"nm_leave"]; } nsinteger sumarray = [[totalhours valueforkeypath:@"@sum.integervalue"] floatvalue]; nsinteger approved = [[approve valueforkeypath:@"@sum.integervalue"] intvalue]; nslog(@"sumarray : %f", [[totalhours valueforkeypath:@"@sum.integervalue"] floatvalue]); nslog(@"approve : %ld", approved); nslog(@"subtask : %@", subtasknames); } } else { } - (nsinteger)numberofsectionsintableview:(uitableview *)tableview { #warning potentially incomplete method implementation. // homecoming number of sections. homecoming 1; } -(nsinteger) tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { homecoming [projectnames count]; } -(uitableviewcell*) tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath{ static nsstring *identitifier = @"cell"; tableviewcell * cell = [tableview dequeuereusablecellwithidentifier:identitifier forindexpath:indexpath]; if ([[[timesheetid objectatindex:indexpath.row] stringvalue] isequaltostring:@"0"]) { cell.lblprojects.text = [nsstring stringwithformat:@"%@",@"no projects filled"]; cell.lbltasks.text = [nsstring stringwithformat:@"%@",@"no tasks filled"]; cell.lblsubtasks.text = [nsstring stringwithformat:@"%@",@"no subtasks filled"]; cell.lblhours.text = [nsstring stringwithformat:@"%@",@"0 hours filled"]; cell.accessorytype = uitableviewcellaccessorynone; cell.selectionstyle = uitableviewcellselectionstylenone; } else if ([[leaves objectatindex:indexpath.row] isequaltostring:@"0"]) { cell.lblprojects.text = [projectnames objectatindex:indexpath.row]; cell.lbltasks.text = [tasknames objectatindex:indexpath.row]; cell.lblsubtasks.text = [subtasknames objectatindex:indexpath.row]; cell.lblhours.text = [[totalhours objectatindex:indexpath.row] stringvalue]; //nslog(@"cell :%@",cell.lblhours.text); } else { cell.lblprojects.text = [leaves objectatindex:indexpath.row]; cell.lbltasks.text = [nsstring stringwithformat:@"%@",@"no projects/tasks on date"]; cell.lblsubtasks.text = [nsstring stringwithformat:@"%@",@"no sub tasks on date"]; cell.lblhours.text = [[totalhours objectatindex:indexpath.row] stringvalue]; } cell.editingaccessorytype = uitableviewcellaccessorydetaildisclosurebutton; nsnumber *myprojectarraystring = [timesheetid objectatindex:indexpath.row]; cell.hdbrowcount = [nsstring stringwithformat:@"%@",myprojectarraystring]; homecoming cell; }

ios uitableview

No comments:

Post a Comment