Error after upgrading to Xcode 4.5 / iOS-Simulator 6.0


#1

Hi,

I have a problem with my Homepwner application since upgrading Xcode (4.4 --> 4.5) and the iOS simulator (5.1 --> 6.0) today.
When running my app on the new iphone simulator (no issues, build succeeded) I get the following error (and the screen on the simulator stays black):

I downloaded an older version of Xcode/Simulator to see if I inadvertently changed something in the code without noticing it, but no, with the 5.1 simulator everything still works fine.

I know there have been some changes (see for example http://forums.bignerdranch.com/viewtopic.php?f=214&t=5351) but I wasn’t able to find something about this particular problem.
Can somebody help me?


#2

Try this to see if it helps:

  • Reset the simulator;
  • In Xcode: Do a clean and then build.

#3

Test


#4

Resetting and cleaning didn’t work either :frowning: still the same error
but thanks all the same


#5

Delete the ItemsViewController.xib file from your project. Open the simulator app and delete the application from the home screen. Try running again.


#6

Problem solved. Thanks Joe!


#7

Hi Joe, Hi everyone,

as I decided to “revive” the ItemsViewController.xib file (to be able to add e.g. a toolbar in the IB), I have been working on the above mentioned problem again and - after a good deal of work - I finally managed to solve it without having to delete the ItemsViewController.xib :

In ItemsViewController.h :
I turned the UITableViewController into an UIViewController, added <UITableViewDelegate, UITableViewDataSource> and gave it a property to hold a tableView:

[code] #import <Foundation/Foundation.h>
@interface ItemsViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, UIPopoverControllerDelegate>
{
IBOutlet UITableView *tableView;
}
@property (nonatomic, strong) UITableView *tableView;

  • (IBAction)addNewItem:(id)sender;
    @end[/code]

In ItemsViewController.h :

[code]@implementation ItemsViewController
@synthesize tableView;

  • (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
    {
    self = [super initWithNibName:@“ItemsViewController” bundle:nil];
    if (self)
    {
    // configure the navigationBar:
    UINavigationItem *navItem = [self navigationItem];
    [navItem setTitle: @“Homepwner”];
    UIBarButtonItem *barButtonAddItem = [[UIBarButtonItem alloc]
    initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
    target:self
    action:@selector(addNewItem:)];
    [navItem setRightBarButtonItem: barButtonAddItem];
    [navItem setLeftBarButtonItem: [self editButtonItem]];
    }
    return self;
    }

  • (void)viewDidLoad
    {
    [super viewDidLoad];

    // to get UITableViewStyleGrouped -> see IB Attributes Inspector

    UIImageView *backgroundImageView = [[UIImageView alloc]
    initWithImage: [UIImage imageNamed:@“background.jpg”]];
    [tableView setBackgroundView: backgroundImageView];

    UINib *nib = [UINib nibWithNibName:@“HomepwnerItemCell” bundle:nil];
    [tableView registerNib:nib forCellReuseIdentifier:@“HomepwnerItemCell”];
    }
    [/code]

I then hooked up the connections in the InterfaceBuilder.
For the File’s Owner:
Outlets:
tableView - Table View
view - View
Referencing Outlets:
dataSource - Table View
delegate - Table View

For the View:
Referencing Outlets:
view - File’s Owner

For the Table View (on the View):
Outlets:
dataSource - File’s Owner
delegate - File’s Owner
Referencing Outlets:
tableView - File’s Owner

In addition, in the identity inspector, I changed the File’s Owners class to: ItemsViewController.

… I also implemented:

- (void)setEditing:(BOOL)editing animated:(BOOL)animated { [super setEditing:editing animated]; [[self tableView] setEditing:editing animated]; }

After these changes everythings looks the same as before :slight_smile:


#8

OMG, this bug claimed 1.5 hrs of my life. Thanks, @ibex10, for that solution, though I had to go through the process of cleaning (Product | Clean) and rebuilding twice, deleted the “app” from the simulator (long-press, hit the X on the dancing icon), and shut down the simulator twice. Finally the error stopped showing.

This is ridiculous. Here I am trying to learn how to program this device, doing it the “right way”, and I get thrown by errors. I have zero confidence with setting up view controllers because XCode keeps throwing me erroneous error messages.

Here’s another bug that claimed another hour of my life on Sunday:
When you create class files (.h and .m) for a view in a storyboard, the correct way to connect the storyboard view to the overriding class file is to select the view’s View Controller in the storyboard, and go to Identity Inspector, and select the class file from the Custom Class pull down menu. However sometimes XCode just doesn’t feel like showing your new class in the list. The only resolution others and I have found is to close all instances of XCode and relaunch the project. THEN XCode shows the correct list in the Custom Class menu. (Of course, I’ll try the Clean step before closing the application next time). This, too, is absurd.

I’m more than just ticked that I’ve spent 2.5 hrs of the last 48 debugging my code when it is Apple who has made the error.