Using the following code I am always getting category.subCategories count to be 0 using the Xcode debugger
Category *category = [[Category alloc] init];
category.title = @"Pubs & Bars";
category.icon = @"cat_pubs&bars";
category.subCategories == [[NSMutableArray alloc] init];
Category *subCategory = [[Category alloc] init];
subCategory.title = @"Test Sub Category 1";
[category.subCategories addObject:subCategory];
The object defined using the following code:
@interface Category : NSObject {
NSInteger *categoryId;
NSMutableString *title;
NSString *icon;
NSMutableArray *subCategories;
}
@property(assign,nonatomic,readonly) NSInteger *categoryId;
@property(nonatomic,copy) NSMutableString *title;
@property(nonatomic,copy) NSString *icon;
@property(nonatomic,retain) NSMutableArray *subCategories;
@end