How to subclass UIApplication?

前端 未结 4 1422
清酒与你
清酒与你 2020-11-30 10:27

The iPhone Reference Libary - UIApplication says I can subclass UIApplication, but if I try this I will get an exception:

*** Terminating app due to uncaught         


        
4条回答
  •  一生所求
    2020-11-30 10:45

    In your app's info.plist, make sure you change the NSPrincipalClass key to the name of your subclass. This'll make Cocoa instantiate the correct class when the applications loads - you shouldn't have to do anything other than that to get your subclass working.

提交回复
热议问题