Hi guys,
this is my first post, so... first of all, I introduce myself. I'm programming Objective-C for iPhone SDK since one month, so.... take a little patience...
I have one problem tryin' to section a tableview.
I have a JSON string with a format like this:
Code:
{
"Clients": [
"Section": "A",
"Clients": [
{
"Id": 136,
"Referencia": "CL0146",
"RazonSocial": "AIR-FAL, S.L.",
"CIF": "B50110253",
"Provincia": "Zaragoza",
"Localidad": "VILLANUEVA DE GALLEGO"
},
{
"Id": 54,
"Referencia": "CL0051",
"RazonSocial": "AKI BRICOLAJE ESPAÑA S.L.",
"CIF": "B83985713",
"Provincia": "Barcelona",
"Localidad": "BARBERÀ DEL VALLÈS"
},
.
.
.
.
.
Of course, I have a MutableArray for every Client and every section filled in ViewDidLoad. I think everything are worked but numberOfRowsInSection.
I mean, I hardcode numberOfRowsInSection returning 1 if section == 0, and tableview shows first section well, so I think 2 arrays are well formed.
Now, the problem is that implementation of numberOfRowsInSection is
Code:
return [[self.sections valueForKey:[[[self.sections allKeys] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)] objectAtIndex:section]] count];
And always return 0.
I don't know what I'm doing wrong, any suggest please.
Thanks.