I need to programmatically remove a button from a window in Cocoa but the only method close to this was dealloc in NSObject, but this is not what I want to do. Is there a way to actually delete the button from the window not just deallocate its memory?
Macos – Programmatically Removing a Button from a Window in Cocoa OSX
cocoamacosnsbutton
Related Topic
- Macos – How to discover number of *logical* cores on Mac OS X
- Macos – Programmatically controlling a Cocoa Button on OSX (making it invisible and pressed)
- Objective-c – Programmatically creating an NSTableView (trouble getting the NSHeaderView to show up)(cocoa osx)
- Objective-c – How to close a window programmatically in Cocoa Mac
- Java – Where is Java Installed on Mac OS X
- Java – How to install Java 8 on Mac
Best Answer
Send the removeFromSuperview message to the button instance.
Though perhaps you just want to hide it instead (using
setHidden:
)?