views:

106

answers:

1

After installing Monobjc and playing around with the Monobjc Application Project under C# in MonoDevelop, I noticed that there is only an empty Monobjc project under the VB section.

Obviously this template adds all the correct references but doesn't add the basic files for the application to run. I've tried creating a class with:

Imports System
Imports Monobjc
Imports Monobjc.Cocoa

Class Application

    Public Sub Main(Byval args() As String) 

        ObjectiveCRuntime.LoadFramework("Cocoa")
        ObjectiveCRuntime.Initialize()

    End Sub

End Class

Obviously I'm not loading the NIB there either, as I haven't added that in either, but if I try to build this I get:

/Source/VB_Sample/VB_Sample/<MyGenerator>(1,1): Error VBNC30420: Could not find a 'Sub Main' in ''. (VBNC30420) (VB_Sample)

Where should I be putting the Sub Main?

Also if I add in a xib file from IB, how do I generate the designer code for the partial AppDelegate class?

Any help would be appreciated.

+1  A: 

Main has to be Shared:

Public Shared Sub Main()
    ...
End Sub
gammelgul
Doh! Of course. Thanks for that. Any thoughts on the XIB/NIB designer generation?
Ira Rainey
It's OK, I've sorted it now.
Ira Rainey