Hi,
I need help with a little something.
I use Core Data to make this happen:
I have a main tableView where categories are stored. When one of the categories are pressed, another tableView is pushed and display that specific categories content. There is a one-to-many relationship between the category and content.
I want to display the total number of content in the categories tableview row, for each of the category. I manage to do this for just a single category by putting this code after the fetchrequest in the contents tableView controller:
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *numberString = [NSString stringWithFormat:@"%i", [contentArray count]];
[defaults setObject: numberString forKey:kContentNumber];
And then in the category viewcontroller, I just load the number from NSUserDefault, and display it in the tableView. Of course, the number become the same for all the categories row.
My challenge is to get the specific number from each of the content, and display it to the related category.
Any help will be highly appreciated. Thanks in advance