1

あるクラスにUibuttonがあり、別のクラスにUitableがあります...

ここで、IndexPAth(特定のセルの位置) を異なるクラスの Uibutton と比較したいと思います...

実際には、別のクラスの異なる異なる Uibutton のメソッドからフェッチしている特定のセルに異なる異なる値を出力したい....

これが私のコードです....

- (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 {
}
4

2 に答える 2

0

UITableViewのアップルのドキュメントを確認してください。

于 2013-01-03T10:25:06.233 に答える
0

他のクラスのボタンを使用して、注目しているクラスで fetchtFormArray222 をロードしてから UITableView をリロードする新しいフェッチを実行しようとしましたか?

于 2012-04-20T14:41:17.153 に答える