`
flycomos.lee
  • 浏览: 280507 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

版本升级之'initWithFrame:reuseIdentifier:' is deprecated

    博客分类:
  • ios
 
阅读更多

在iOS3.0之后的版本不再使用这样的语法,解决方法如下:
将:

C代码  收藏代码
  1. cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];  

  修改为:

C代码  收藏代码
  1. cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; 
分享到:
评论

相关推荐

    联网指示器效果

    - (id)initWithFrame:(CGRect)frame andStyle:(WMProgressStyle)styleType andTitle:(NSString *)title ZZProgressHUD. { if (self = [super initWithFrame:frame]) { _frame = frame; self.styleType = style...

    封装版_小白点_类似于 AssistiveTouch 的漂浮按钮

    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)]; view.backgroundColor = [UIColor redColor]; UIView *blue = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)]; blue....

    封装好的类似于 AssistiveTouch 的漂浮按钮

    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)]; view.backgroundColor = [UIColor redColor]; UIView *blue = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)]; blue....

    cocoa animation examples

    mover = [[NSImageView alloc] initWithFrame:moverFrame]; [mover setImageScaling:NSScaleToFit]; [mover setImage:[NSImage imageNamed:@"photo.jpg"]]; [self addSubview:mover]; } - (id)initWithFrame:...

    IOS中的TABLEVIEW 自定义行的实例

    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 10, 200, 30)]; titleLabel.font = [UIFont systemFontOfSize:17]; [self.contentView addSubview:titleLabel]; UIImageView *...

    长按拖动排序

    // StBtnTouchMove *stBtn = [[StBtnTouchMove alloc]initWithFrame:CGRectMake(0, 200, 375, 100)]; // [self.view addSubview:stBtn]; // stBtn.buttonArray = [[NSMutableArray alloc]init]; // for (NSInteger i...

    ios-点击切换状态の按钮Multi-Button.zip

    MultiButton *btn = [[MultiButton alloc]initWithFrame:CGRectMake(0, 0, 200, 30)]; btn.center = CGPointMake(self.view.center.x, 300); [btn setName:@"volume" state:@"11"]; [self.view addSubview:...

    iOS自定义collectionView实现毛玻璃效果

    说下思路,很简单,首先自定义一个collectionView, 重写它的initWithFrame:collectionViewLayout:方法,在这里面做配置,这里用的是AXECollectionView. 与之对应的自定义一个collectionViewCell,在cell里配置操作:设置...

    仿网易自动循环广告,也可手动滑动

    UIImageView imageView [[UIImageView alloc]initWithFrame:self adViewContainerInPersonalView bounds]; imageView image [UIImage imageNamed:[NSString stringWithFormat:@"MQLADPlaceholderPic%d" ...

    ios-获取验证码按钮.zip

    XFetchCodeButton * button = [[XFetchCodeButton alloc] initWithFrame:CGRectMake(20, 100, 100, 50)]; button.backgroundColor = [UIColor blackColor]; [self.view addSubview:button]; [button ...

    IOS点赞效果按钮源代码下载

    CatZanButton *zanBtn=[[CatZanButton alloc] initWithFrame:CGRectMake(0, 0, 50, 50) zanImage:[UIImage imageNamed:@"Zan"] unZanImage:[UIImage imageNamed:@"UnZan"]]; [zanBtn setCenter:self.view.center]; ...

    ios-TitleMenuView.zip

    -(instancetype)initWithFrame:(CGRect)frame WithViewControllers:(NSArray *)array WithStyle:(TitleMenuScrollViewStyle) titleMenuStyle WithTitleFont:(CGFloat)font AndTitleInterval:(CGFloat)space; ...

    ios-简单九宫格布局-分享菜单页面展示.zip

    简单的一个分享菜单展示界面,...IGCusShareView *view = [[IGCusShareView alloc] initWithFrame:self.view.bounds]; [view showFromControlle:self]; github下载:https://github.com/luckyxiangfeng/IGShareViewDemo

    广告轮播控件

    WMLoopView *loopView = [[WMLoopView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.width/1.8) images:images autoPlay:YES delay:10.0]; loopView.delegate = self...

    ios-水波图;支文字在2种颜色之间交换显示;.zip

    self.percentView = [[ZBPercentWaterView alloc] initWithFrame:CGRectMake(100, 100, 200, 200)]; [self.view addSubview:self.percentView]; //设置进度: [self.percentView setupProgress:(arc4random...

    ios-iOS自定义视频播放器(avPlayer简易版).zip

    JWPlayer*player=[[JWPlayer alloc]initWithFrame:CGRectMake(0, 0, 414,9*414/16)]; [player updatePlayerWith:[NSURL URLWithString:@"http://120.25.226.186:32812/resources/videos/minion_01.mp4"]]; ...

    ForFlipCountDownDemo:3D翻页效果的倒计时

    (2)调用JHFlipCountDownView类的一个接口:-(id)initWithFrame:(CGRect)frame countDownType:(COUNT_DOWN_TYPE)countDowntype countDownTime:(NSDate *)countDownTime; 代码如下: JHFlipCountDownView *...

    归档操作,源码

    CustomImgView *customView = [[CustomImgView alloc]initWithFrame:CGRectMake(50, 100, 200, 200)]; customView.backgroundColor = [UIColor redColor]; //需要做的事情,写在block里面 [customView setBlock:^...

    ios-CRBoxInputView.zip

    CRBoxInputView *boxInputView = [[CRBoxInputView alloc] initWithFrame:CGRectMake(0, 0, 200, 50)]; [boxInputView loadAndPrepareView]; [self.view addSubview:boxInputView]; 其他用法请查看github主页:...

Global site tag (gtag.js) - Google Analytics