V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
laobaozi
V2EX  ›  iDev

从自定义的 window 启动 cocoa app

  •  
  •   laobaozi · Jan 28, 2016 · 2672 views
    This topic created in 3752 days ago, the information mentioned may be changed or developed.

    标题可能描述不准确
    类似于 ios 创建 app 时默认创建 Main.storyboard,然后从这里启动.修改 info.plist,再在 AppDelegate 中设置 rootViewController 就可以从自定义的界面启动了,现在要在 cocoa 中实现类似的效果要怎么做,或者该查怎么查资料
    //删除了 info.plist 中的启动项,然后程序貌似就不会进 AppDelegate 了....

    2 replies    2016-02-03 16:54:39 +08:00
    HeartJ
        1
    HeartJ  
       Feb 1, 2016 via iPad
    自定义的界面是在 storyboard 中吗?选中要启动的界面,设置成 initial 就可以吧?我是小白,不知道是不是你说的意思。
    vincentxbb
        2
    vincentxbb  
       Feb 3, 2016
    var mainWindowController:MainWindowController?

    func applicationDidFinishLaunching(aNotification: NSNotification) {
    // Insert code here to initialize your application

    let mainWindowController = MainWindowController()
    mainWindowController.showWindow(self)
    self.mainWindowController = mainWindowController


    }


    MainWindowController 重写他的 windowNibName,返回对应的 xib 文件名字就可以啦,假如是 sb 的话,参照楼上的应该也没问题,不用删除 info.plist 的启动项的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1232 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 17:36 · PVG 01:36 · LAX 10:36 · JFK 13:36
    ♥ Do have faith in what you're doing.