#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行,在编译的时候提醒自己需要处理的地方。

 
 

#warning Incomplete method implementation怎么修改?的更多相关文章

  1. Android-Could not find method implementation() for arguments

    当AndroidStudio加载工程的时候:报以下错误: 详细错误: Could not find method implementation() for arguments [file collec ...

  2. Error:(23, 0) Could not find method implementation() for arguments [directory 'libs'] on object of t

    Error:(28, 0) Could not find method implementation() for arguments [com.android.support:appcompat-v7 ...

  3. UI:UITableView 编辑、cell重用机制

    tableView编辑.tableView移动.UITableViewController tableView的编辑:cell的添加.删除. 使⽤场景: 删除⼀个下载好的视频,删除联系⼈: 插⼊⼀条新 ...

  4. cell高度自动适应文章内容

    效果: 描述:表视图中生成多个不同的cell,cell的高度跟文字内容的多少有关 要求:需要自己在网上下载一个plis文件,然后修改两个标题 一 : 创建工程文件UIAutomaticCellHeig ...

  5. iOS 表视图(UITableVIew)的使用方法(1)表视图的示例

    表视图继承自UIScrollView,所以有着大多UIScrollView的操作特性,诸如手指控制内容的滚动,内容视图到顶端或者低端时的自动反弹等.配合UINavigationController的导 ...

  6. IOS6新特性之下拉刷新<UIRefreshControl>

    在IOS6未发布之前,几乎都是使用那个UIRefresh在实现下拉刷新,甚至有人还是先了上拉的功能,不得不说牛人很多啊.可能是Apple意识到了这个功能的实用性,在IOS6中增加了下拉刷新,但是上啦还 ...

  7. OC开发_代码片段——使用Xib自定义tableViewCell

    一.实现步骤 1.新建一个XIB文件:描述cell——tableCell.xib 2.新建UITableViewCell的子类,也就是cell文件:封装XIB内部的所有东西——TestCell.m \ ...

  8. Storyboards Tutorial 04

    设计好后运行发现没有任何变化,是空白的.这是因为你的tableview相关的delegate方法还在.所以首先要屏蔽或者删除在PlayerDetailsViewController.m 如下的操作 # ...

  9. IOS第二天-新浪微博 - 添加搜索框,弹出下拉菜单 ,代理的使用 ,HWTabBar.h(自定义TabBar)

    ********HWDiscoverViewController.m(发现) - (void)viewDidLoad { [super viewDidLoad]; // 创建搜索框对象 HWSearc ...

随机推荐

  1. python 之 os._exit() sys.exit() 、exit()

    sys.exit 执行该语句会直接退出程序,这也是经常使用的方法,也不需要考虑平台等因素的影响,一般是退出Python程序的首选方法. 退出程序引发SystemExit异常,(这是唯一一个不会被认为是 ...

  2. c#之静态构造函数和单例模式

    1.静态构造函数:在创建第一个实例或引用任何静态成员之前,将自动调用静态构造函数来初始化类 public class A { ; : private static A instance_; publi ...

  3. Maven pom.xml 常用打包配置

    <build> <!-- 指定JAVA源文件目录 --> <sourceDirectory>src</sourceDirectory> <!-- ...

  4. csharp:DropDownComboxTreeView

    using System; using System.Collections.Generic; using System.Text; using System.Drawing; using Syste ...

  5. JavaScript常用类

    JS常用类 一.Number 1.常用数字 整数:10 小数:3.14 科学计数法:1e5 | 1e-5 正负无穷:Infinity | -Infinity 2.常用进制 二进制:0b1010 八进制 ...

  6. after() 和 remove() 实现替换

    <div class="replacedDiv">this is the replaced div</div> <script>         ...

  7. [SYZOI Round1] 滑稽♂树

    题面 传送门 Sol 我也不知道哪里来的题目哪里来的\(OJ\) 子树变成\(DFS\)序后就是裸的树套树 # include <bits/stdc++.h> # define RG re ...

  8. for 循环的时候 append() 是移动不是复制

    使用for 的时候,append() 不是复制,而是移动,只有最后一个元素才真正的append() 到了 解决办法: 1. 使用字符串: 2.使用clone();

  9. C#链接数据库:SQL Server 2008

    自己学习C#编程,在WinForm编程中,代码测试连接数据库. 现在sqlserver中测试使用的数据库能否以指定的用户名和密码登录. 如图所示,计算机名为administrator,数据库实例为sq ...

  10. ES入门——数组的扩展

    1.Array.from() 该方法用于将两类对象转为真正的数组:类似数组的对象(array-like object)和可遍历(iterable)的对象,包括ES6新增的数据结构Set和Map.下面是 ...