My program contains three textfields and I am inserting the data into an sqlite database. Now I am trying to display the data from the database in the tableview. For that I tried to add the data into an NSMutableArray and tried to print that. But it is showing a null value in the array. I don't know why I am getting a null value. cont is the NsMutableArray.
[cont addObject:name.text];
[cont addObject:address.text];
[cont addObject:phone.text];
NSLog(name.text);
NSLog(address.text);
NSLog(phone.text);
int length= sizeof(cont);
NSString *strlen = [NSString stringWithFormat:@"%d", length];
NSLog(strlen);
for(int i=0;i<strlen;i++)
{
NSArray *arr = [cont objectAtIndex:i];
NSString *u = [NSString stringWithFormat:@"%d",i];
NSLog(u);
NSLog(arr);
}
I am always getting length as 4 and null in arr. Can anyone please tell me why it is so? I know there must be some error in the code.