How do I create a Cocoa window programmatically?

前端 未结 5 970
执念已碎
执念已碎 2020-12-04 08:21

My Cocoa app needs some small dynamically generated windows. How can I programmatically create Cocoa windows at runtime?

This is my non-working attempt so far. I see

5条回答
  •  忘掉有多难
    2020-12-04 09:17

    Try

    [window makeKeyAndOrderFront:self]; 
    

    instead of

    [window display];
    

    Is that what you're aiming for?

提交回复
热议问题