Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread Display Modes
Old Aug 5, 2008, 12:41 PM   #1
macrumors newbie
Join Date: Aug 2008
Interface Builder - Event on UIButton?

Alright... my first post here and I am pretty stuck

I create a simple UI using IB..

I have a tabbar .. which loads its view from an external xib file. in this external xib file i have the file's owner as a custom UIViewController class.. and inside I dragged a UIView .. now so far everything works fine.. when i run it in simulator i can see the view loaded and everything

Now i wanted to add a UIButton to the UIView and handle the "event" on the UIButton in the UIViewController class..

any idea how an i do it?

when I create an IBOutlet UIButton* button; in my UIViewController class it crashes on me.. how can i do this then?

any tips?

newdev is offline   0 Reply With Quote
Old Aug 5, 2008, 04:02 PM   #2
Moderator emeritus
kainjow's Avatar
Join Date: Jun 2000
Setup an IBAction method, and then in IB control-click from your button to File's Owner (or whatever object in the NIB represents your view controller) and select your method. This method will get called whenever your button is clicked.
kainjow is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Interface Builder WTF. SolarShane Mac Programming 2 Mar 12, 2014 02:38 AM
Resolved: Can't move objects in Interface Builder moonman239 iPhone/iPad Programming 0 Jan 13, 2014 07:14 PM
Pashua gui tool interface elements anything similar in xcode interface builder wild4life2013 Mac Programming 1 Aug 10, 2013 08:13 PM
OpenGL ES without interface builder? blueshogun96 iPhone/iPad Programming 1 Feb 10, 2013 01:04 PM
Interface Builder Crashes Every Time wickerman1893 iPhone/iPad Programming 5 Jun 29, 2012 06:57 AM

Forum Jump

All times are GMT -5. The time now is 04:22 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013,, LLC