Deallocating and removing UiButtons
问题 I am trying to make a program that dynamically creates a button using the command: [UIButton buttonWithType:UIButtonTypeRoundedRect] But when I use these commands the delete the button I create: [currentButton removeFromSuperview]; [currentButton dealloc]; [currentButton release]; I receive an error. How would I go about removing and deallocating the memory from a uibutton? 回答1: In the Objective-C/Cocoa framework, you encounter two different ways to receive objects: ones which you have