Lim Thye Chean Lim Thye Chean - 1 year ago 122
Swift Question

How to fix main.swift in Mac Project?

I wanted to update an old Mac project in Swift, and after all the conversion to Swift 3, I was faced with this error:

Use of unresolved identifier 'C_ARGV'
Use of unresolved identifier 'C_ARGC'

And the issue is with this file: main.swift, which consists of only 2 statements:

import Cocoa
NSApplicationMain(C_ARGC, C_ARGV)

How can I fixed this to make my project work again?

Answer Source

Add @NSApplicationMain on the top of the AppDelegate class (above the class... line) and delete main.swift.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download