Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

voidmain

macrumors newbie
Original poster
Mar 18, 2014
7
0
Being a OS X user, you must be quite familiar with the "New Documents" window when you start some of these star apps: Pages, Pixelmator, Sketch and so on.

Yp5vX.png


I'm building a document-based app, and I want to popup this window when user launches my app. This window is so common, that I 99% sure it is a system-provided window. But I couldn't find it.

I can mimic the window, but this process must be really tedious and buggy. For example, I have to manage the list-style switch using NSBrowser, NSSourceList and NSTableList, also, there are bunch of code managing drag and drop, search, iCloud integration... The list must be pretty long, and I felt this wheel is really not needed to be reinvented...

So, my question is how can I implement this window, is there any documentation writing about this window? Big thanks!
 

voidmain

macrumors newbie
Original poster
Mar 18, 2014
7
0
This windows has some minor differences with NSOpenPanel

Thanks guys for your reply, and I've added iCloud support in my app:

ScreenShot2014-07-06at74304AM_zpsb2038222.png


Also, I've fired the NSOpenPanel with the following code:

Code:
NSOpenPanel *panel = [NSOpenPanel openPanel];
    [panel beginWithCompletionHandler:^(NSInteger result){
        if (result == NSFileHandlingPanelOKButton) {
            NSURL*  theDoc = [[panel URLs] objectAtIndex:0];

            // Open  the document.
            NSLog(@"What: %@", theDoc);
        }
        
    }];

But the panel has some minor differences with the window I'm looking for. Here's the NSOpenPanel:

ScreenShot2014-07-06at74142AM_zpse0bade15.png


You can notice that there's no iCloud tab, and to me, the panel does have a `New Document` button... Am I wrong with iCloud setup?
 

voidmain

macrumors newbie
Original poster
Mar 18, 2014
7
0
Got that window..

It turns out all you need to do to get this window is enable iCloud support..

What took me so long is the window doesn't show up with Swift/Xcode6-Beta, I don't know why... I've started a fresh new project in Xcode5 with ObjC, and enabling iCloud in `Capabilities` page does give me this window..

Thanks guys for your help!
 

960design

macrumors 68040
Apr 17, 2012
3,703
1,571
Destin, FL
It turns out all you need to do to get this window is enable iCloud support..

What took me so long is the window doesn't show up with Swift/Xcode6-Beta, I don't know why... I've started a fresh new project in Xcode5 with ObjC, and enabling iCloud in `Capabilities` page does give me this window..

Thanks guys for your help!

Thanks for taking the time to come back and let us know what happened. You probably saved me several frustrating hours, hopefully it will help more and/or get fixed before I need it for real.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.