相关疑难解决方法(0)

将项目转换为使用ARC时,"切换案例是否在受保护的范围内"是什么意思?

将项目转换为使用ARC时,"切换案例是否在受保护的范围内"是什么意思?我正在转换一个项目使用ARC,使用Xcode 4编辑 - >重构 - >转换为Objective-C ARC ...我得到的一个错误是"切换案例在受保护的范围内"的"部分"交换机开关盒.

编辑,这是代码:

ERROR标记在"默认"情况下:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"";
    UITableViewCell *cell ;
    switch (tableView.tag) {
        case 1:
            CellIdentifier = @"CellAuthor";
            cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
            if (cell == nil) {
                cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        }
        cell.textLabel.text = [[prefQueries objectAtIndex:[indexPath row]] valueForKey:@"queryString"];
        break;
    case 2:
        CellIdentifier = @"CellJournal";
        cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        }
        cell.textLabel.text = [[prefJournals …
Run Code Online (Sandbox Code Playgroud)

xcode objective-c automatic-ref-counting

283
推荐指数
4
解决办法
7万
查看次数