zoukankan      html  css  js  c++  java
  • #warning Incomplete method implementation怎么修改?

    #warning Incomplete method implementation怎么修改?   

     
     
     
    各位朋友,我在做一个表格视图的例子,在tableview方法里总有几个warning:
    #warning Incomplete method implementation

    #warning potentially Incomplete method implementation

    这个方法我修改了下,绝对是没有问题的,但是warning总消不掉,但可以正常编译运行。

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
    #warning Incomplete method implementation.
        // Return the number of rows in the section.
       return [self.File count];
    }

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath/////#warning  potentially  method implementation.
    {
        static NSString *CellIdentifier = @"Cell";
        
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        }  /////////#warning Incomplete method implementation.
        cell.textLabel.text = [self.File objectAtIndex:indexPath.row];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        // Configure the cell...
        
        return cell;
    }

    请各位大大审阅下 
     
     

    从Xcode 4开始,建立TableViewController,自动生成的代码都会自动来上这两行,目的是警告开发者需要完成numberOfRows、numberOfSections等方法的实现。看你的代码,已经完成了相关工作,这个时候就可放心的把#warning ...行删除掉,再编译的时候就会没有警告了。

    同理,在我们开发过程中,对不确定、错误、bug、待定的代码,也可手工插入#warning行,在编译的时候提醒自己需要处理的地方。
     
     
    iOS开发者交流群:180080550
  • 相关阅读:
    数30的小程序
    convert curl command into java HttpGet
    优秀技术文章转载备份 --- 变速原理
    用 c 调用 win-api 实现自动点击c# winform 程序 的按钮
    win 10 安装 glew 方法
    《想到什么更新什么系列》processing 性能优化
    processing 根据物体移动方向改变朝向
    openFrameworks 无法生成exe已经找不到dll的解决方案
    UE4 无法打开源文件“file_name.generated.h”(Cannot open source file name.generated.h)
    UE4 重新编译老版本的插件
  • 原文地址:https://www.cnblogs.com/stevenwuzheng/p/4631427.html
Copyright © 2011-2022 走看看