相关疑难解决方法(0)

为什么我在xcode 6 beta中得到"必须将自动调整掩码转换为约束以使_setHostsLayoutEngine:YES"

我在swift UITableViewController中有以下代码,但我得到一个"必须将自动调整掩码转换为约束,以便在第二行有_setHostsLayoutEngine:YES异常.我没有更改界面构建器中的任何设置(因此都检查了Autolayout和大小类).

override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell? {
    let cell:TodoItemCell = tableView.dequeueReusableCellWithIdentifier("TodoItemCell", forIndexPath: indexPath) as TodoItemCell
    let row = indexPath.row
    cell.titleLabel.text  = self.todoItems![row].title
    self.callback!(row)
    // Configure the cell...

    return cell
}
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

swift xcode6

40
推荐指数
6
解决办法
2万
查看次数

UITableview Cell异常 - '必须将自动调整掩码转换为约束才能使_setHostsLayoutEngine:YES

我正在使用UITableView.

 CategoryCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifierLink];
Run Code Online (Sandbox Code Playgroud)

这是我收到错误的一行.它在IOS 7中工作.但是当我在IOS 8中运行应用程序时,我收到错误

** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Must translate autoresizing mask into constraints to have _setHostsLayoutEngine:YES.
Run Code Online (Sandbox Code Playgroud)

编辑

完整代码

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *CellIdentifierImageLink = @"NewsImageAndLink";
    static NSString *CellIdentifierImage = @"NewsImage";
    static NSString *CellIdentifierLink = @"NewsLink";
    static NSString *CellIdentifier = @"NewsDescription";

    NSString *image=[[_news objectAtIndex:indexPath.row] valueForKey:@"imageURL"];
    NSString *link=[[_news objectAtIndex:indexPath.row] valueForKey:@"link"];
    NSString *description=[[_news objectAtIndex:indexPath.row] valueForKey:@"description"];
    NSString *date=[[_news objectAtIndex:indexPath.row] valueForKey:@"date"];
    NSString *title=[[_news objectAtIndex:indexPath.row] valueForKey:@"title"];

    NSMutableString *html = [NSMutableString stringWithString: …
Run Code Online (Sandbox Code Playgroud)

objective-c uitableview ios ios7 ios8

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

ios ×1

ios7 ×1

ios8 ×1

objective-c ×1

swift ×1

uitableview ×1

xcode6 ×1