简体   繁体   中英

How to present a new custom NSView (modally?)

I'm working on my first Cocoa app being an iOS Developer. So far I found most of the information I needed online but I'm having trouble to figure out how to show a new custom NSView / NSWindow (not sure which) as show below:

A push in the right direction is more than welcome..

语气

You can use NSPanel with custom view and call

NSPanel *panel=[[NSPanel alloc]initWithContentRect:NSMakeRect(0, 0, 800, 530) styleMask:NSClosableWindowMask backing:NSBackingStoreBuffered defer:YES];
panel.contentView=<# your custom view #>

[self.view.window beginSheet: panel completionHandler:^(NSModalResponse returnCode) {}];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM