我在appdelegate.m文件中收到错误,位于以下代码行:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
}
我之前没有在这些括号内有任何内容,并且在我上次提交和今天打开它之间没有对应用程序进行任何更改。毋庸置疑,我有点被抛弃了。
修改
在描述的初始字段中返回YES
后,我在另一部分代码中收到了相同的错误:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *cellIdentifier = [menu objectAtIndex:indexPath.row];
// UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: cellIdentifier forIndexPath:indexPath];
//return cell;
}
答案 0 :(得分:2)
该方法需要返回BOOL
值。您通常只返回YES
。很可能你的代码已被更改。
答案 1 :(得分:0)
您已注释了返回cell
值的代码。
你的cellforRowatindexpath代码应该是这样的。
您的代码已明确修改。没有这个,应用就无法运行。
请检查一下。
进行与您的应用相关的必要更改。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"SimpleTableItem";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
}
cell.backgroundColor = [UIColor clearColor];
return cell;
}