forum

Home / DeveloperSection / Forums / Dynamically creating Cocoa window:

Dynamically creating Cocoa window:

Anonymous User 1683 12-Oct-2015

I want to creae Cocoa window at runtime, I was trying to generate dynamic window but it is not working,
this is my code:

NSRect myFrame = NSMakeRect(0, 0, 100, 100);
NSUInteger mask = NSBorderlessWindowMask;
NSRect myRect = [NSWindow contentRectForFrameRect:myFrame mask:mask];

NSWindow * myWindow =  [[NSWindow alloc] initWithContentRect:myRect
                       mask:mask backing: NSBackingStoreRetained
                       defer:false];
[myWindow setBackgroundColor:[NSColor blueColor]];
[myWindow display];

My code is generating error and I am new in iOS so I am unable to solve this problem,
please anyone help me.


Updated on 12-Oct-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By