iOS tableViewCell 代理
来源:互联网 发布:机顶盒刷linux 编辑:程序博客网 时间:2024/06/05 01:07
#import <UIKit/UIKit.h>
#import "CompeteListModel.h"
@protocol RankDelegate <NSObject>
-(void)rankClick:(NSString*)number;
@end
@interface CompeteTableViewCell :UITableViewCell
@property (nonatomic,strong)CompeteModel *model;
@property (nonatomic,weak)id<RankDelegate> delegate;
@property (weak,nonatomic) IBOutletUIView *upYellow;
@property (weak,nonatomic) IBOutletUIView *downYellow;
@end
- (IBAction)rank:(id)sender {
if ([self.delegaterespondsToSelector:@selector(rankClick:)]) {
[self.delegaterankClick:self.model.tnno];
NSLog(@"代理%@",self.model.tnno);
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
staticNSString *ID =@"CompeteTableViewCell";
CompeteTableViewCell *cell = [tableViewdequeueReusableCellWithIdentifier:ID];
if (cell==nil) {
cell =[[[UINibnibWithNibName:ID bundle:nil]instantiateWithOwner:selfoptions:nil]objectAtIndex:0];
cell.selectionStyle =UITableViewCellSelectionStyleNone;
}
if (self.type) {
cell.upYellow.backgroundColor=[UIColoryellowColor];
cell.downYellow.backgroundColor=[UIColoryellowColor];
}else
{
cell.upYellow.backgroundColor=kColor(0,143, 226);
cell.downYellow.backgroundColor=kColor(0,143, 226);
}
// cell.model=_competeModel1.tournamentList[indexPath.row];
cell.model=_arrayList[indexPath.row];
cell.delegate=self;
return cell;
}
-(void)rankClick:(NSString *)number
{
NSLog(@"点击了代理%@",number);
competeRankTableController *comRankVC=[[competeRankTableControlleralloc] init];
comRankVC.model=number;
NSDictionary *dict = [[NSDictionaryalloc]initWithObjectsAndKeys:comRankVC,@"Hidden",nil];
NSNotification *notification = [NSNotificationnotificationWithName:@"tongzhiHidden"object:niluserInfo:dict];
[[NSNotificationCenterdefaultCenter]postNotification:notification];
[self.tabBarController.viewsetFrame:CGRectMake(0,0, IPHONE_WIDTH,IPHONE_HEIGHT + 60)];
[self.navigationControllerpushViewController:comRankVCanimated:YES];
}
- iOS tableViewCell 代理
- iOS代理实现tableViewCell中的button在viewController中响应
- ios 自定义tableviewcell
- iOS 自定义tableViewcell
- IOS Tableviewcell总结
- IOS TableViewCell 透明背景
- ios 自定义tableViewcell,UITableViewCell
- ios tableViewCell重用
- iOS TableViewCell 的伸缩
- IOS之TableViewCell重用
- iOS tableviewCell点击行高变高
- IOS-TableViewCell滑动删除
- iOS 自定义TableViewCell封装
- iOS 加载xib tableViewCell
- IOS TableViewCell嵌套webview
- iOS TableViewcell 全选删除
- iOS TableViewCell ~reuseIdentifier(标识符)
- [iOS] TableViewCell 自适应高度
- Android Spinner
- 文章标题
- 蜜罐发展史
- hdu3068 Manacher模板
- Java Integer 判等误区
- iOS tableViewCell 代理
- 安卓Selector失效、无用的解决方案
- 漫谈程序员系列:咦,你也在混日子啊
- ELF格式详解
- MFC中按钮的图片的变化,静态/hover/press,利用GDI
- 自己整理的OkHttp工具——留存用
- Bundle传数据
- [转]CocoaPods 详解之—-更新篇
- oracle 查询十分钟之前的数据