-2

Possible Duplicate:
IBOutlet and IBAction

I'm relatively new to Objective C, but not with programming in which I have experience with both C and Python. I was wondering what an IBAction method is and what it can do, and how to incorporate it into my program. And, if possible, is there a way in C to bypass this method and just simply write it all in C? Thanks in Advance

Community
  • 1
  • 1
objective_c_pro
  • 925
  • 2
  • 8
  • 9

1 Answers1

4

IBActions are simply of type void. However, you would want to use IBAction instead for the sake of Interface Builder.

Interface Builder is the integrated service in Xcode you use to design your application, and attach the layout to code. Interface Builder 'knows' what you want to connect because they are of one of those two types. Once you define your IBOutlet or IBAction in your code, you literally drag and drop to connect it to something in Interface Builder. You can use an IBAction, for example, if you want to make a touch event listener (or something along those lines).

You can read more about IBOutlets and IBActions from the Apple Developer page on the topic at https://developer.apple.com/library/mac/#documentation/General/Conceptual/Devpedia-CocoaApp/TargetAction.html (It's an article for OS X developers, but it still applies to iOS since the two are built very similar frameworks).

Kyle Lacy
  • 2,278
  • 1
  • 21
  • 29