Hi again Jesse,
I've created a sample application for you that does exactly what you want, please find it attached to this post (since this forum is public domain, I naturally omitted all STV files, so please add them to the "Sensible TableView" folder inside the application folder).
Following is an overview of how the sample application functions:
After seeing your data structure, it became very clear to me that STV's object-binding method is the way to go. I've used object-binding instead of key-binding because your data structure is hierarchical, and I wanted STV to generate all the detail views for me automatically based on the object hierarchy. I basically created two objects that reflect your data structure, Area & Company:
@interface Area : NSObject
{
NSString *name;
NSMutableArray *companies;
}
@property (nonatomic, copy) NSString *name;
@property (nonatomic, readonly) NSMutableArray *companies;
@end
@interface Company : NSObject
{
NSString *name;
NSString *address;
UIImage *logo;
}
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *address;
@property (nonatomic, retain) UIImage *logo;
@end
The rest was really easy. I just created a class definition for Company and another one for Area, then created an NSMutableArray called areasArray that should be loaded with areas from your xml file. I finally added an SCArrayOfObjectsSection to STV representing the areasArray, and STV took everything else from there.
Please tell me if you have any questions, I'd love to hear your feedback.
This attachment is hidden for guests. Please log in or register to see it.