Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- static NSString *MyIdentifier = @"MyIdentifier";
- CustomCells *cell = (CustomCells *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
- if (cell == nil) {
- CGRect startingRect = CGRectMake(0.0, 0.0, 320.0, 100);
- cell = [[[CustomCells alloc] initWithFrame:startingRect reuseIdentifier:MyIdentifier] autorelease];
- }
- ClassObj *appdelegate = (ClassObj *)[[UIApplication sharedApplication] delegate];
- ClassObj *itemAtIndex = (ClassObj *)[appdelegate.allClass objectAtIndex:indexPath.row];
- [cell setData:itemAtIndex];
- return cell;
- }
- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
- - (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier {
- if (self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) {
- // Initialization code
- // we need a view to place our labels on.
- UIView *myContentView = self.contentView;
- /*
- init the title label.
- set the text alignment to align on the left
- add the label to the subview
- release the memory
- */
- self.titleLabel = [self newLabelWithPrimaryColor:[UIColor blackColor] selectedColor:[UIColor whiteColor] fontSize:22.0 bold:YES];
- self.titleLabel.textAlignment = UITextAlignmentLeft; // default
- [myContentView addSubview:self.titleLabel];
- [self.titleLabel release];
- /*
- init the url label. (you will see a difference in the font color and size here!
- set the text alignment to align on the left
- add the label to the subview
- release the memory
- */
- self.urlLabel = [self newLabelWithPrimaryColor:[UIColor blackColor] selectedColor:[UIColor lightGrayColor] fontSize:10.0 bold:NO];
- self.urlLabel.textAlignment = UITextAlignmentLeft; // default
- [myContentView addSubview:self.urlLabel];
- [self.urlLabel release];
- }
- return self;
- }
Add Comment
Please, Sign In to add comment