xamarin / mac-samples

Sample programs showing how to use Xamarin.Mac on OSX.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MacXibless does not work perfectly

GT85 opened this issue · comments

MacOS Mojave 10.14.6, VS for Mac Community 8.5.4

Hello.

  1. I tried to create the MacXibless app (Xamarin sample) from the beginning (new Mac Cocoa app, etc.). This new app opens 2 windows, a big one explicitly created (with the button and the label), but also - and first - a small empty one (the standard window that is displayed by an empty new app). How can I prevent this small undesired window to be displayed ?
  2. Why is there a MainMenu.xib file in the sample ? The app works the same way with or without this file.
    Regards,
    Gilbert
  1. Check your Info.plist and the associated storyboard/xib to make sure there isn't a default window. This example can be difficult to exactly copy.

  2. The project actually compiles that file:

https://github.com/xamarin/mac-samples/blob/master/MacXibless/MacXibless/MacXibless.csproj#L71

though we don't use it for the initial menu. While it is possible to drop that file, Cocoa really expects an initial xib/storyboard and I've seen strange behavior in the past. Maybe Apple has fixed all of that now?

Do you believe there is an issue w\ the sample, or are you just having trouble reproducing it?

Hi Chris.
You are right, Main.storyboard was specified as main interface in info.plist. I deleted this information (so: no more main interface in info.plist), and it works correctly.
No need of any .xib file also.
Thanks for your quick answer.
Gilbert