`
flycomos.lee
  • 浏览: 276331 次
  • 性别: 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:...

    长按拖动排序

    // 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:...

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

    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主页:...

    ios-LGLSearchBar.zip

    LGLSearchBar * searchBar = [[LGLSearchBar alloc] initWithFrame:CGRectMake(10, 200, SCREENWIDTH - 20, 40) searchBarStyle:LGLSearchBarStyleDefault]; [searchBar searchBarTextSearchTextBlock:^(NSString ...

    时间选择器

    IFPSelectBornTimerView *timer = [[IFPSelectBornTimerView alloc] initWithFrame:self.view.bounds]; timer.curDate = [NSDate date]; timer.delegate = self; [timer datePickShow]; } 代理方法: -(void)...

    QHDanumuDemo:弹幕系统实现

    说明: QHDanmu文件夹下是主要的弹幕模块系统QHDanmuSend文件夹下是简单的发射弹幕的界面使用可以参考ViewController创建弹幕self.danmuManager = [[QHDanmuManager alloc] initWithFrame:CGRectMake(0,...

Global site tag (gtag.js) - Google Analytics