简体   繁体   中英

Xcode coding help NSButton

I am a new Mac progremmer and I am trying to do some theng like: with Obj-c

... == Something that I know how to do

...

...

wait (for user)

button clickd (some button)

if button 1 clickd {

...

wait (for user)

button clickd (some button)

if dutton 1 clickd {

...
 } 

else if dutton 2 clickd {
... 
}
}

else if button 2 clickd {

...
 }

else {

...
 }

Move your else if block to separate methods and use setAction: to connect a button and its action method . You can also use Interface builder to connect methods to buttons.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM