microsoft / WinObjC

Objective-C for Windows
MIT License
6.24k stars 808 forks source link

NSBundle -pathForResource:ofType: returning nil #2770

Open steventroughtonsmith opened 7 years ago

steventroughtonsmith commented 7 years ago

Upgrading to the latest release version of WinObjC via chocolatey, I find that NSBundle is returning nil from -pathForResource:ofType:.

This prevents my MainMenu.nib from being loaded at UIApplication start, so I get no UI and no app delegate loaded.

I tried following the NSBundle commits all the way down but I gave up somewhere after CFBundleCopyFindResources.

Just me? Known issue?

My app returns "E:/Projects/grace-ios/Debug/Grace/AppX" for its mainBundle -resourcePath. The path is correct, but I reasoned maybe WinObjC doesn't like non-C: resource paths now?

Worked as of February release.

DHowett-MSFT commented 7 years ago

I'm having trouble reproducing this:

    NSString* x = [[NSBundle mainBundle] pathForResource:@"BezierViewController" ofType:@"nib"];
+ x 0x00c1ed90 "E:/src/WinObjC/samples/WOCCatalog/Debug/WOCCatalog/AppX/BezierViewController.nib"   NSString * {_NSCFString}

Is there anything unusual about your bundle?

edvv commented 7 years ago

@steventroughtonsmith Can you make sure the MainMenu file is in the AppX directory? It could be that it is failing translation, is not there and the perception is that pathForResource is not working.