I am absolutely clueless on this front! Step-by-step explanation earns bonus points.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- back button text does not change
- iOS (objective-c) compression_decode_buffer() retu
- Stop child process when parent process stops
相关文章
- 现在使用swift开发ios应用好还是swift?
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- didBeginContact:(SKPhysicsContact *)contact not in
- Custom Marker performance iOS, crash with result “
- Why is my library not able to expand on the CocoaP
Not exactly sure of all the steps to do that in code, but what I would do is use the interface builder to create the button where you want it. Then when you load the view, make the button hidden in the viewDidLoad or viewDidAppear method. Make the button visible when you need to. Hope this helps.
In iOS We have UIButtons (not NSButtons)
Here is how to create an UIButton programmatically:
and :
1: if you are in a
UIViewController
, thenaView
will beself.view
if you are somewhere else, just pass the view that will contain your button2: the easiest case is like that but you can set any object as a target. That object must have to have the method you pass in the
@selector(...)
. Otherwise you app will crash when pressing the button.