Xcode Crash - Unable to load MainMenu.nib

Discussion in 'Mac Programming' started by preetib, Jul 22, 2010.

  1. preetib macrumors newbie

    Joined:
    Jul 21, 2010
    #1
    Hi,

    I had my code working well in Xcode until I cleaned all the targets from build menu. Since then my application crashes saying
    "Unable to load nib file: MainMenu, exiting"

    As per few threads I tried searching for the MainMenu.xib file and it is there in the Resources folder (both in Xcode and through Finder). If I attempt to open it from both these places it opens well in Interface Builder. I also checked if all my views and objects were connected in Interface Builder and they are. Any idea as to what mus be going wrong?

    Thanks,

    -Preeti
     
  2. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #2
    Don't do that? :p

    On a more serious note, when your application is launched via Xcode, it requires at least one target be present in the project, so everything can be configured correctly. Does your application launch when double-clicked outside Xcode? If it does, then there's your problem.
     
  3. preetib thread starter macrumors newbie

    Joined:
    Jul 21, 2010
    #3
    Got to know never to do that!

    Anyway I fixed it. Yes my targets were not set. I ran into another problem hope you could tell me. I have a folder with 11 property lists in it. I want to copy all these property lists into a NSDictionary. I am doing it as follows:

    NSString *presetPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:mad:"Presets/"];
    //NSArray *presetMenu = [[NSArray alloc]init];
    BOOL isDir = YES;
    if (![[NSFileManager defaultManager] fileExistsAtPath:presetPath isDirectory:&isDir] && isDir).............(It detects this path)
    {
    [[NSFileManager defaultManager] createDirectoryAtPath:presetPath attributes:nil];
    }
    NSDictionary *presetDict = [[NSDictionary alloc]initWithContentsOfFile:presetPath];............(But doesn't copy anything into the directory)

    Can you tell me how should I achieve this?

    Thanks,

    -Preeti
     

Share This Page