Our Smartphone Network: BlackBerryWindows MobileAndroidPalm Pre
iPhone Forums
EverythingiCafe iPhone cases, accessories iPhone Social iPhone Wallpapers iPhone forums iPhone blog iPhone accessory reviews iPhone news

Go Back   iPhone Forums > Desktop Software > Developers




Reply
 
LinkBack Thread Tools Display Modes
Old 08-20-2008, 01:36 PM   #1 (permalink)
 
fury's Avatar
 
Join Date: Oct 2007
Posts: 1,059
Thanks: 24
Thanked 34 Times in 26 Posts
Default Fast track to dragging and dropping in Interface Builder: - (IBAction)methodName;

That little ditty just saved me a ton of time and made it a cinch to connect the view in Interface Builder to the controller in Xcode. It wasn't entirely obvious until I saw it in one of the project templates and tried to make sense of it myself.

In other words, place this in your ViewController header file (ViewController.h)

- (IBAction)methodName;
& draw up your method in the implementation (ViewController.m) like so:

- (IBAction)methodName {
doSomething;
}
Save the header and implementation files, then open the respective XIB file. Right-click on a button, slider, or whatever to bring up the list of events it catches (e.g. for buttons, the default is Touch Up Inside). Drag from the circle on the right over to File's Owner in the XIB folder window. It should bring up another little window in which you can select the action you just made. Then whenever that action is performed on the control, your action code will be performed. Also found that right-click-dragging straight from the control in question over to File's Owner will pick that control's most likely desired default event. Note: File's Owner should expect to be set to an instance of your specific ViewController, otherwise it won't know what actions you've made possible in your code. This is how it's set up by default if you pick one of the template applications like Flipside, etc.; but otherwise, you can make sure of it by going to the right-most tab on Inspector, and at the top, give it an appropriate class name to expect.

That was the missing link for me when I tried playing with the earlier betas of the SDK - I couldn't quite figure out how to drag and drop to link things up, and this just saved me a ton of time on a concept UI that I whipped up real quick.

Sorry I don't have screenshots to show at the moment, the computer it's on isn't connected to the net
__________________
back in white baby! 32 gig that is!

Last edited by fury; 08-20-2008 at 05:58 PM..
fury is offline  
Digg this Post!Share on Facebook!
Reply With Quote
Old 12-03-2008, 02:52 PM   #2 (permalink)
 
chrismmm's Avatar
 
Join Date: Dec 2007
Location: Gwinnett, Georgia
Posts: 708
Thanks: 4
Thanked 4 Times in 4 Posts
Default

have u found an appl or are u developing one that will allow power users to drag and drop files...tired of hearing about sftp..know how to do that and its not effective
__________________
chrismmm

2.1 jb-Pwn'd -no turning back
"fortune favors the brave" -N. Machiavelli
chrismmm is offline  
Digg this Post!Share on Facebook!
Reply With Quote
Old 12-10-2008, 01:19 AM   #3 (permalink)
 
fury's Avatar
 
Join Date: Oct 2007
Posts: 1,059
Thanks: 24
Thanked 34 Times in 26 Posts
Default

That's a different subject entirely. I was referring here to the ability to make logical connections from your interface (and the buttons and such; the events that occur on them) to your code in the iPhone SDK by dragging and dropping with Interface Builder. It's a little bit of info that wasn't too obvious to me when I started to learn the SDK so I thought I'd post it here for anyone else looking around the same way I was before the light bulb switched on. (That, and keep a memory for myself, since I don't actually have a genuine Mac of my own to develop on)
__________________
back in white baby! 32 gig that is!

Last edited by fury; 12-10-2008 at 01:21 AM..
fury is offline  
Digg this Post!Share on Facebook!
Reply With Quote
Reply

Tags
nda be damned


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -5. The time now is 07:32 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Integrated by BBpixel