Skip navigation

Deleted nib file still appears to get loaded.

3310 Views 6 Replies Latest reply: Aug 31, 2011 9:17 AM by Poringkiller RSS
m_userName Level 1 Level 1 (0 points)
Currently Being Moderated
Oct 19, 2010 5:49 AM
I have a class which is a subclass of UITableViewController. In the header file, it has

@interface RootViewController : UITableViewController
UITableViewCell* tableViewCell;


and in the implementation file, it has

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
static NSString* cellIdentifier = @"TableViewCell";

UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil)
[[NSBundle mainBundle] loadNibNamed:@"TableViewCell" owner:self options:nil];
cell = tableViewCell;
tableViewCell = nil;

return cell;

The thing that is confusing me is that I deleted TableViewCell.xib a long time ago, but apparently it still seems to be working (as opposed to throwing an exception when it attempts to load from that nib file). However, the cell that is loaded is in exactly the same style as the changes I made to that nib file.

I have made sure that I have cleaned the project since deleting, and that it is that particular line which is definitely the tableViewCell variable to be loaded. I'm not sure how to check if there are any references to the old nib file in the project, or how to delete them if there are.

P.S. This problem is unrelated to the other posts I've made regarding the dimensions of the table, since this is related to a different controller.
MacBook Pro, iOS 4
  • RayNewbie Level 5 Level 5 (6,810 points)
    Currently Being Moderated
    Oct 19, 2010 7:03 AM (in response to m_userName)
    A few suggestions:

    1) Ctrl-click on the project name at the root of the Groups & Files tree on the left side of your project window, and select "Reveal in Finder". In the Finder window, locate the Build folder and delete it;

    2) The Groups & Files tree should have a "NIB Files" group near the bottom. Expand that group to see if TableViewCell.xib is listed;

    3) Do a search for TableViewCell.xib in every volumn in your environment (Finder->File->Find...).

    \- Ray
    iMac, Mac OS X (10.5.8)
  • RayNewbie Level 5 Level 5 (6,810 points)
    Currently Being Moderated
    Oct 19, 2010 9:36 AM (in response to m_userName)
    m_userName wrote:
    I've tried those steps, and the xib file definitely isn't there (I can do a search for the xib file in the entire project and it isn't there), and deleting the build file didn't work.

    Instead of only searching the project, I would recommend searching your hard disk as well as any other accessible volumes. Though unlikely, it's possible the xib is someplace the project knows about. For example, when adding an existing file to a project, if you don't check "Copy items ... (if needed)", the project will access the file wherever it lives. Of course such a link should be broken when the file is deleted from the project, but if not... Stranger things have happened with Xcode.

    I guess, if you really want to work on this, you might also try importing all your source files into a new project. That should rule out the contents of the .xcodeproj package. Wish I could help more. but I'm outta ideas for now.

    \- Ray
    iMac, Mac OS X (10.5.8)
  • Poringkiller Calculating status...
    Currently Being Moderated
    Aug 31, 2011 9:17 AM (in response to m_userName)

    an other method is to modify your xib a bit, so xCode will detect a modification (last modified date in file system) and will load xib from its actual path.


More Like This

  • Retrieving data ...

Bookmarked By (0)


  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.