I have a Uibutton in one class and Uitable in different Class…
Now i want to compare IndexPAth(Particular cell Position) with Uibutton Of Different class…
Actually i want to print Different different value on particular cell Which I am Fetching from Different Different Uibutton`s Methods from another class….
Here is My code….
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//- (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] autorelease];
}
if(indexPath == btn1){ // This is the Line What i want , i am trying this but dont go inside the condition..
UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(200, 5, 290, 60)];
lbl.backgroundColor = [UIColor clearColor];
//lbl.editable = NO;
lbl.font = [UIFont fontWithName:@"Helvetica-Bold" size:25];
// txtView1.text= textviewstring;
// txtView1.text = @"Personal";
if([fetchFormArray222 count]<1){
lbl.text=@"";
}
else{
lbl.text = [fetchFormArray222 objectAtIndex:0];
}
// [txtView1 setDelegate:self];
lbl.textColor = [UIColor blackColor];
lbl.textAlignment = UITextAlignmentLeft;
[[cell contentView] addSubview:lbl];
}
else {
}
Check the apple documentation of UITableView.