initWithFrame : reuseIdentifier : is deprecated

后端 未结 4 1278
轻奢々
轻奢々 2020-12-14 06:45

In my project i\'ve got a Deprecations warning, initWithFrame : reuseIdentifier : is deprecated

I don\'t know what it mean, could some one tell me how to resolve thi

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-14 07:11

    This should solve your problem:

    static NSString *SimpleTableIdentifier;
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:SimpleTableIdentifier];
    
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero
                                       reuseIdentifier:SimpleTableIdentifier] autorelease];
    }
    

提交回复
热议问题