Header Banner
gadgethacks.mark.png
Gadget Hacks Shop Apple Guides Android Guides iPhone Guides Mac Guides Pixel Guides Samsung Guides Tweaks & Hacks Privacy & Security Productivity Hacks Movies & TV Smartphone Gaming Music & Audio Travel Tips Videography Tips Chat Apps

How to Make your first iPhone app with Xcode

Nov 13, 2010 12:48 PM
A user interface design for an iPhone app showing the text "Hello iPhone" and a button labeled "Tap me."

In this video from XcodeMod we learn how to make an iPhone app with Xcode. Open up XCode and go to File...New Project. Pick what kind of app you'd like to save it as and come up with a name to save it as and save it to your desktop. Open the Classes folder and go into the AppDelegate.H. In the space above @end, type - (IBAction) buttonTapped to create a button. Save that, copy that line and paste it where you want the button in your appdelegate.M. Now in Resources folder open the Mainwindow.xib folder and theInterface Builder will open up. You can change the background color here. He changes it to gray in the video. Create a label and you can type what you want there. He types Hello iPhone here since that's the app he is creating. From here he drags a button in and labels it Tap Me. In the Inspector, make the Tag 55. And label the button Touch Down in the drop down menu. Now go back into the delegate.h and type the following:

UILabel * Label = {UILabel *} [Window ViewWithTag: 55];

if[(label. text isEqualtoString: @"HelloiPhone")]

{label.text = helloWorld!};

}else

label.text = @HelloiPhone

Now build and run and save all

Click Tap Me, it should change to HelloWorld.

Now you've made your first app.

You already know how to use your phone. With our newsletter, we'll show you how to master it. Each week, we explore features, hidden tools, and advanced settings that give you more control over iOS and Android than most users even know exists.

Sign up for Gadget Hacks Weekly and start unlocking your phone's full potential.

Related Articles

Comments

No Comments Exist

Be the first, drop a comment!