UIImageView in UITableViewCell not showing up until cell is being reused - iphone

I am having a weird issue with a custom UITableViewCell implementation that I have:
- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
ProfileTableViewCell *cell = (ProfileTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[ProfileTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
MyStory *myStory = (SavedStory *)[fetchedResultsController.fetchedObjects objectAtIndex:indexPath.row];
[cell setupCellViewWithSavedStory:myStory];
return cell;
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithPulseStyle:PNRTableViewCellAccessoryDefault reuseIdentifier:#"SavedStories"];
if (self) {
storyImageView_ = [[UIImageView alloc] initWithFrame:CGRectMake(kPadding, kPadding, kImageSize, kImageSize)];
storyImageView_.layer.borderWidth = 2.0;
storyImageView_.layer.borderColor = [UIColor whiteColor].CGColor;
storyTitleLabel_ = [[UILabel alloc] initWithFrame:CGRectMake(storyImageView_.frameRight + kPadding*1.5, storyImageView_.frameY, self.bounds.size.width - storyImageView_.frameWidth - 4*kPadding, 0)];
storyTitleLabel_.numberOfLines = 0;
storyTitleLabel_.lineBreakMode = UILineBreakModeClip;
storyTitleLabel_.font = [UIFont fontWithName:kProximaNovaBold size:14];
storyTitleLabel_.textColor = [UIColor whiteColor];
storyTitleLabel_.backgroundColor = [UIColor clearColor];
storyPublisherLabel_ = [[UILabel alloc] initWithFrame:CGRectMake(storyTitleLabel_.frameX, storyTitleLabel_.frameHeight, storyTitleLabel_.frameWidth, 50)];
storyPublisherLabel_.numberOfLines = 1;
storyPublisherLabel_.font = [UIFont fontWithName:kProximaNova size:11];
storyPublisherLabel_.textColor = [UIColor colorWithWhite:140/255.f alpha:1.0];
storyPublisherLabel_.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:storyImageView_];
[self.contentView addSubview:storyTitleLabel_];
[self.contentView addSubview:storyPublisherLabel_];
}
return self;
}
-(void)setupCellViewWithSavedStory:(MyStory *) myStory
{
if (myStory.imageState == StoryImageAvailableOnDisk) {
storyImageView_.hidden = NO;
storyImageView_.image = myStory.image;
}
else {
storyImageView_.image = nil;
storyImageView_.hidden = YES;
}
CGSize titleSize = [myStory.title sizeWithFont:storyTitleLabel_.font constrainedToSize:CGSizeMake(storyTitleLabel_.frameWidth, kImageSize - kPadding) lineBreakMode:storyTitleLabel_.lineBreakMode];
[storyTitleLabel_ setFrameHeight:titleSize.height];
[storyTitleLabel_ setText:savedStory.title];
[storyPublisherLabel_ setText:savedStory.domain];
[self setNeedsLayout];
}
But for some reason is that I can't see image until I scroll down and scroll back up again. In other words the image is reused then I can see the image. All of the label text is showing just fine, it's just the image. Any idea why?

Try adding this code:
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
MyStory *myStory = (SavedStory *)[fetchedResultsController.fetchedObjects objectAtIndex:indexPath.row];
[cell setupCellViewWithSavedStory:myStory];
}

Have you tried this?
if (cell == nil) {
cell = [[ProfileTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
MyStory *myStory = (SavedStory *)[fetchedResultsController.fetchedObjects objectAtIndex:indexPath.row];
[cell setupCellViewWithSavedStory:myStory];
}

Related

UITableViewCell iOS6

I have project(AppDelegate, ViewController and UITableViewCell).
//ViewController.m(Excerpt)
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
TableCell *cell = (TableCell *)[myTableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
//====A====
cell = [[TableCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier];
//====B==== //cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
UIView *bgView = [[UILabel alloc] initWithFrame:CGRectZero];
cell.backgroundView = bgView;
for(UIView *view in cell.contentView.subviews){
view.backgroundColor = [UIColor clearColor];
}
}
cell.titleLabel.text = [NSString stringWithFormat:#"%# %i", #"row", indexPath.row];
if(indexPath.row % 2){
cell.backgroundView.backgroundColor = [UIColor whiteColor];
}else{
cell.backgroundView.backgroundColor = [UIColor colorWithRed:0.0 green:0.0 blue:1.0 alpha:0.1];
}
return cell;
}
//TableCell.m(UITableViewCell class)
#import "TableCell.h"
NSString *CellIdentifier = #"CellIdentifier";
#implementation TableCell
#synthesize titleLabel;
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier
{
if (self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier])
{
titleLabel = [[UILabel alloc] initWithFrame:frame];
titleLabel.font = [UIFont systemFontOfSize:15];
titleLabel.frame = CGRectMake(10.0, 0.0, 320.0, 40.0);
[self.contentView addSubview:titleLabel];
self.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
}
#end
warning(initWithFrame:...iOS3) is generated in the part //===A===. Therefore I write //===B===. Nothing in cell.
I want to get rid warning.
initWithFrame:reuseIdentifier: is a deprecated method since iOS 3.0 (lot of time). Use the newer initWithStyle:reuseIdentifier: and the warning will go away.
UITableViewCell documentation

setIndentationLevel is not working for cell.ContentView subviews

Why setIndentationLevel is not getting with cells subviews?
I have a UITableView. My cellForRowAtIndexPath is like below. The arrow which i added is not shifting with the textlabel. why?
How can I do this?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
UIImageView *img = [[UIImageView alloc]initWithImage:[UIImage imageNamed:#"small_arrow.png"]];
img.frame = CGRectMake(5, 10, 7, 11);
[cell.contentView addSubview:img];
cell.textLabel.text=[[self.tabledata objectAtIndex:indexPath.row] valueForKey:#"name"];
cell.textLabel.font = [UIFont fontWithName:#"Helvetica" size:18];
[cell setIndentationLevel:[[[self.tabledata objectAtIndex:indexPath.row] valueForKey:#"level"] intValue]];
return cell;
}
Yeah !!! Its workin now.
I created a custom cell and its m file is like
#import "customecell.h"
#implementation customecell
#synthesize textLbl,img;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
textLbl = [[UILabel alloc]initWithFrame:CGRectMake(15, 10, 320, 20)];
textLbl.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:textLbl];
img = [[UIImageView alloc]initWithFrame:CGRectMake(5, 10, 7, 11)];
img.image = [UIImage imageNamed:#"small_arrow.png"];
[self.contentView addSubview:img];
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
- (void)layoutSubviews{
[super layoutSubviews];
float indentPoints = self.indentationLevel * self.indentationWidth;
self.contentView.frame = CGRectMake(
indentPoints,
self.contentView.frame.origin.y,
self.contentView.frame.size.width - indentPoints,
self.contentView.frame.size.height
);
}
#end
and the cellForRowAtIndexPath is changed to
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = #"Cell";
customecell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[customecell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
cell.textLbl.text=[[self.tabledata objectAtIndex:indexPath.row] valueForKey:#"name"];
cell.textLbl.font = [UIFont fontWithName:#"Helvetica" size:18];
[cell setIndentationLevel:[[[self.tabledata objectAtIndex:indexPath.row] valueForKey:#"level"] intValue]];
cell.indentationWidth = 25;
float indentPoints = cell.indentationLevel * cell.indentationWidth;
cell.contentView.frame = CGRectMake(indentPoints,cell.contentView.frame.origin.y,cell.contentView.frame.size.width - indentPoints,cell.contentView.frame.size.height);
return cell;
}

UITableViewCell row disorder

I posted some question with same source code before. I just found out some other strange thing.The thing is that If I define reuse cell identifier, each row color is weird.
But If I don't use reuse identifier, its working.
Please give me any tips why each row color does not keep the order.
//its working
static NSString *CellIdentifier = #"Cell";
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:#"Cell"] autorelease]
cell.contentView.backgroundColor = (indexPath.row %2) ? [UIColor redColor] : [UIColor yellowColor];
//it does not work.
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; -- does not working.
cell.contentView.backgroundColor = (indexPath.row %2) ? [UIColor redColor] : [UIColor yellowColor];
- (void)viewDidLoad {
[super viewDidLoad];
//Initialize the array.
listOfItems = [[NSMutableArray alloc] init];
//Add items
[listOfItems addObject:#"1"];
[listOfItems addObject:#"2"];
[listOfItems addObject:#"3"];
[listOfItems addObject:#"4"];
[listOfItems addObject:#"5"];
[listOfItems addObject:#"6"];
[listOfItems addObject:#"7"];
[listOfItems addObject:#"8"];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
// Release anything that's not essential, such as cached data
}
#pragma mark Table view methods
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [listOfItems count];
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UILabel *aLabel; UILabel *bLabel; UILabel *v1Label; UILabel *v2Label;; UIView *v1; UIView *v2;
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSLog(#" cell null");
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.contentView.backgroundColor = (indexPath.row %2) ? [UIColor redColor] : [UIColor yellowColor];
aLabel = [[[UILabel alloc] initWithFrame:CGRectMake(9.0, 8.0, 50.0, 20.0)] autorelease];
aLabel.tag = 1;
aLabel.font = [UIFont systemFontOfSize:30];
[cell.contentView addSubview:aLabel];
v1 = [[UIView alloc] initWithFrame:CGRectMake(0, 44, 320, 116)];
v1.backgroundColor = [UIColor whiteColor];
v1.tag = 10;
v1.hidden = YES;
[cell.contentView addSubview:v1];
[v1 release];
UILabel *a = [[[UILabel alloc] initWithFrame:CGRectMake(0, 10, 100, 100)] autorelease];
a.text = #"v1.test1";
[v1 addSubview:a];
UILabel *b = [[[UILabel alloc] initWithFrame:CGRectMake(0, 40, 100, 100)] autorelease];
b.text = #"v1.test2";
[v1 addSubview:b];
v2 = [[UIView alloc] initWithFrame:CGRectMake(0, 44, 320, 100)];
v2.backgroundColor = [UIColor blueColor];
v2.tag = 11;
v2.hidden = YES;
[cell.contentView addSubview:v2];
[v2 release];
UILabel *c = [[[UILabel alloc] initWithFrame:CGRectMake(0, 10, 100, 100)] autorelease];
c.text = #"v2.test1";
[v2 addSubview:c];
UILabel *d = [[[UILabel alloc] initWithFrame:CGRectMake(0, 40, 100, 100)] autorelease];
d.text = #"v2.test2";
[v2 addSubview:d];
}
else {
aLabel = (UILabel *)[cell.contentView viewWithTag:1];
//
v1 = (UIView *) [cell.contentView viewWithTag:10];
v2 = (UIView *) [cell.contentView viewWithTag:11];
}
aLabel.text = [listOfItems objectAtIndex:indexPath.row];
if (SelectedIndexPath == indexPath.row)
{
if ([aLabel.text intValue] % 2) {
v1.hidden = NO;
v2.hidden = YES;
}
else {
v1.hidden = YES;
v2.hidden = NO;
}
}
else {
v1.hidden = YES;
v2.hidden = YES;
}
return cell;
}
-(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (SelectedIndexPath == indexPath.row)
{
return 162.0;
}
else {
return 46.0;
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (SelectedIndexPath == -1)
{
OldSelectedIndexPath = indexPath.row;
SelectedIndexPath = indexPath.row;
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:NO];
}
else
{
if (SelectedIndexPath == indexPath.row)
{
OldSelectedIndexPath = SelectedIndexPath;
SelectedIndexPath = -1;
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:NO];
}
else
{
SelectedIndexPath = indexPath.row;
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:[NSIndexPath indexPathForRow:OldSelectedIndexPath inSection:indexPath.section], indexPath, nil] withRowAnimation:NO];
OldSelectedIndexPath = SelectedIndexPath;
}
}
}
Move the coloring code outside of the if (cell == nil) { block. Just because a cell was created for an even-numbered index doesn't mean it will only be reused for even ones.
Here's a simple example of code for coloring cells that are being reused:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 20;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = #"Anything";
cell.contentView.backgroundColor = (indexPath.row %2) ? [UIColor redColor] : [UIColor yellowColor];
return cell;
}

The first UITableViewCell's accessary arrow is not showing

Here is the code I am struggling with, the first table cell doesnt display the accessary arrow, but other table cells work fine...
Below is the code for table cell1, other cells is also customized but work fine.
- (void) initialization
{
labelTitle = [[UILabel alloc] initWithFrame:CGRectZero];
labelTitle.font = [UIFont fontForMoreLikeResultTitle];
labelTitle.textColor = [UIColor blackColor];
labelTitle.numberOfLines = 1;
labelTitle.lineBreakMode = UILineBreakModeTailTruncation;
labelTitle.backgroundColor = [UIColor clearColor];
labelFulLAddress = [[UILabel alloc] initWithFrame:CGRectZero];
labelFulLAddress.font = [UIFont fontForMoreLikeResultDescription];
labelFulLAddress.textColor = [UIColor blackColor];
labelFulLAddress.numberOfLines = 1;
labelFulLAddress.lineBreakMode = UILineBreakModeTailTruncation;
labelFulLAddress.backgroundColor = [UIColor clearColor];
[[self contentView] addSubview:labelTitle];
[[self contentView] addSubview:labelFulLAddress];
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self)
{
// Initialization code
[self initialization];
}
return self;
}
- (void) layoutSubviews
{
float xOffset = 20.0f;
float yOffset = 10.0f;
float currentUsedHeight = yOffset;
labelTitle.text = documentTitle;
labelTitle.frame = CGRectMake(xOffset, currentUsedHeight,
320.0f - 2 * xOffset, 60.0f);
[labelTitle sizeToFitHeight];
[labelTitle sizeToFitWidth];
labelFulLAddress.text = #"99999 Bellevue Way NE, Bellevue WA";
currentUsedHeight += (yOffset + labelTitle.frame.size.height);
labelFulLAddress.frame = CGRectMake(xOffset, currentUsedHeight, 320.0f - 2 * xOffset, 60.0f);
[labelFulLAddress sizeToFitHeight];
[labelFulLAddress sizeToFitWidth];
}
Below is the code in view controller:
- (UITableViewCell *) createResultTableCell1:(UITableView *)tableView
{
static NSString *CellIdentifier = #"FirstMoreLikeResultCell";
FirstResultTableCell *cell = (FristResultTableCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[MoreLikeTableCell1 alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
cell.documentTitle = self.documentTitle;
return cell;
}
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell;
if (indexPath.row == 0)
{
cell = [self createResultTableCell1:tableView];
}
else
{
cell = [self createResultTableCell2:tableView cellForRowAtIndexPath:indexPath];
}
return cell;
}
Call [super layoutSubviews] from within your overridden layoutSubviews.

uitableview - data and if (!cell)

I have a big problem with an UITableView, I want to use a label inside the cell, so I use this method for do it
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = #"ItemCell";
// If the indexPath is less than the numberOfItemsToDisplay, configure and return a normal cell,
// otherwise, replace it with a button cell.
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
else {
}
if (indexPath.section == 0) {
elemento = [array objectAtIndex:indexPath.row];
UILabel *labelTitle = [[UILabel alloc] initWithFrame:CGRectMake(100, 0, 220, 30)];
labelTitle.text = [elemento objectForKey:#"Titolo"];
labelTitle.backgroundColor = [UIColor clearColor];
labelTitle.textColor = [UIColor whiteColor];
[cell addSubview:labelTitle];
} else {
UILabel *labelTitle = [[UILabel alloc] initWithFrame:CGRectMake(100, 0, 220, 30)];
labelTitle.text = #"Read More";
labelTitle.backgroundColor = [UIColor clearColor];
labelTitle.textColor = [UIColor whiteColor];
[cell addSubview:labelTitle];
}
return cell;
}
in this way I can see all the data on my table, but the label are overlap, than I try to use this method
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = #"ItemCell";
// If the indexPath is less than the numberOfItemsToDisplay, configure and return a normal cell,
// otherwise, replace it with a button cell.
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
if (indexPath.section == 0) {
elemento = [array objectAtIndex:indexPath.row];
UILabel *labelTitle = [[UILabel alloc] initWithFrame:CGRectMake(100, 0, 220, 30)];
labelTitle.text = [elemento objectForKey:#"Titolo"];
labelTitle.backgroundColor = [UIColor clearColor];
labelTitle.textColor = [UIColor whiteColor];
[cell addSubview:labelTitle];
} else {
UILabel *labelTitle = [[UILabel alloc] initWithFrame:CGRectMake(100, 0, 220, 30)];
labelTitle.text = #"Read More";
labelTitle.backgroundColor = [UIColor clearColor];
labelTitle.textColor = [UIColor whiteColor];
[cell addSubview:labelTitle];
}
}
else {
}
return cell;
}
the label are OK but in this case I can see on my table only 5 data, and this 5 data are repeat for some time...
For example if in the first case on my table I can see: 1,2,3,4,5,6,7,8,9,10,...
in the second case I seee: 1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,...
where is the problem?
add this code
for (UIView *view in [cell.contentView subviews])
{
[view removeFromSuperview];
}
before
if (indexPath.section == 0) {
elemento = [array objectAtIndex:indexPath.row];
UILabel *labelTitle = [[UILabel alloc] initWithFrame:CGRectMake(100, 0, 220, 30)];
labelTitle.text = [elemento objectForKey:#"Titolo"];
labelTitle.backgroundColor = [UIColor clearColor];
labelTitle.textColor = [UIColor whiteColor];
[cell addSubview:labelTitle];
Currently you add a label to the cell and the next time the cell is reused..the label is still there and you add a label on top of it.
The code you posted is specifying UITableViewCellStyleSubtitle as the cell style, which means each cell will a text label and detail text label available in its corresponding properties textLabel, and detailTextLabel. So there's no reason for you to allocate additional instances of UILabel. Instead, just populate the text properties of the existing labels. For example, you could rewrite your implementation like this:
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellID = #"ItemCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellID];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellID];
cell.textLabel.backgroundColor = [UIColor clearColor];
cell.textLabel.textColor = [UIColor whiteColor];
}
cell.textLabel.text = (indexPath.section == 0 ?
[array objectAtIndex:indexPath.row] :
#"ReadMore");
return cell;
}