. . , UIView, .
@interface TimeAroundView : UIView
{
NSString *title;
UIImage *image;
}
@property (nonatomic, retain) NSString *title;
@property (nonatomic, retain) UIImage *image;
@end
, . NSArray, TimeAroundView, . ,
timeAroundViewObject.userInteractionEnabled = NO;
- (id) init - , - :
- (id)init
{
self = [super init];
if (self) {
NSMutableArray *viewArray = [[NSMutableArray alloc] init];
TimeAroundView *earlyMorningView = [[TimeAroundView alloc] initWithFrame:CGRectZero];
earlyMorningView.title = @"Early Morning";
earlyMorningView.image = [UIImage imageNamed:@"12-6AM.png"];
earlyMorningView.userInteractionEnabled = NO;
[viewArray addObject:earlyMorningView];
[earlyMorningView release];
TimeAroundView *lateMorningView = [[TimeAroundView alloc] initWithFrame:CGRectZero];
lateMorningView.title = @"Late Morning";
lateMorningView.image = [UIImage imageNamed:@"6-12AM.png"];
lateMorningView.userInteractionEnabled = NO;
[viewArray addObject:lateMorningView];
[lateMorningView release];
self.customPickerArray = viewArray;
[viewArray release];
}
return self;
}
pickerView: viewForRow: forComponent: reusingView: .
.