objective c - Unable to parse JSON to UITableView -
Currently I'm trying to parse responseObject
to populate my table view But I'm having some problems in parsing the array in response. I want to populate my cell with values from responseObject [@ "test"]
Request Functions:
FHTPPRKAccess Operation Manager * Manager = [FHTPTPAST Operation Manager Manager]; [Manager post: [kBaseURL stringByAppendingString: @ "directori / member_list"] Parameters: Parameter success: ^ (F.httipafefaction * operation, id response object) {nslog (@ "answer:% @", referee); If ([responseObject [@ "status_reason"] is elevation: @ "success"]) {self. All Members = Response Object [@ "Test"]; NSLog (@ "Member:% @", all of itself); } Else {// Handle Error}} Failure: ^ (FHTPPKAEASTA Operation * Operation, NSERR * Error) {NSLog (@ "Error:% @", Error); }];
As you can see below, test
is an array of objects
Sample feedback objects: < / P>
Answers: {test = ({img = "http://test.com/assets_api/images/no_image .png"; location = "test location"; name = "test user"; Status = "test";}); "Audit_no" = ""; "Status" = 200; "Status_reason" = success; }
And here's my table data source to see.
View table data source
- (UITableViewCell *) TableView: (UITableView *) Table View CellForAindindpath: (NSIndexPath *) Indexing Path {Fixed NSString * CellIdentifier = @ "DirectoryCell"; DirectoryViewCell * cell = (DirectoryViewCell *) [tableview dequeueReusableCellWithIdentifier: CellIdentifier]; If (cell == blue) {cell = [[DirectoryViewCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: CellIdentifier]; } NSDictionary * Member = [auto. All object otandex: indexpath.ro]; NSLog (@ "Member:% @", Member); Return cell; }
allmail
is of type NSArray
while member
is type NSDictionary
. When I try to login the value of member
then it becomes zero, where was it wrong?
You should try to do this
NSDictionary * member = [[Self. All members objectOtindex: IndexPath.ro] ObjectItindex: 0];
Comments
Post a Comment