To update an image file in Xcode, follow these steps;
- Delete existing image and select Move to Trash
- Drag and drop new image file into the correct project folder
- Select Product > Clean build from menu
- Click on Run app triangle in upper left of Xcode to verify
Are you new to developing applications for iPhone & iPad? This blog provides articles to help you learn Xcode, Apple's developer toolset. It assumes you have little prior experience coding.
Tuesday, April 8, 2014
Sunday, March 16, 2014
Using NSLog
This tutorial will should you how to use the NSLog function to display things in the debugging console. This can be useful to see what going on inside the app like verifying the values of variables.
Open main.m file
Insert NSLog command after @autoreleasepool and inside of the brackets { }
}
Verify that the console is displayed by clicking on the hide/display console area button in the upper right.
Run the application by clicking on the triangle in the upper left of the screen.
See more https://www.youtube.com/watch?v=to7bfqCeQIs
Open main.m file
Insert NSLog command after @autoreleasepool and inside of the brackets { }
@autoreleasepool {
NSLog(@"Come in Berlin"); }
Verify that the console is displayed by clicking on the hide/display console area button in the upper right.
Run the application by clicking on the triangle in the upper left of the screen.
See more https://www.youtube.com/watch?v=to7bfqCeQIs
Tuesday, February 18, 2014
How do I add launch images to my Xcode app?
In Xcode 5, launch images are stored in a folder called images.xcassets
To access this folder, click the folder icon in the project navigator and open the Images folder, then click on images.xcassets, see screenshot below.
This example is taken from VidaLingua dictionary apps. The launch images are common to all apps but the app icons are language specific which is why they appear in separate folders.
To add a launch image, make sure you it is sized correctly, then drag and drop it in on the appropriate thumbnail in the right-most panel.
To access this folder, click the folder icon in the project navigator and open the Images folder, then click on images.xcassets, see screenshot below.
This example is taken from VidaLingua dictionary apps. The launch images are common to all apps but the app icons are language specific which is why they appear in separate folders.
To add a launch image, make sure you it is sized correctly, then drag and drop it in on the appropriate thumbnail in the right-most panel.
Sunday, February 16, 2014
How can I create a View Controller in Xcode 5?
View Controllers are basic building blocks of iPhones and iPad apps. A View Controller allows you to control what you see in a view (screen) of an app. For example, if you want to display some text and a button on a screen, you would do it using a View Controller.
This video is a bit different then the article below.
To use a View Controller we need to setup a Project with the following steps. For more detailed instructions, see article on how to Make a Hello World App.
- Start Xcode
- Click on Create a new Xcode project
- Select Single View Application and click Next
- Enter a Product Name and click Next
- Select a folder where you want to save the Project and click Create
Now we are ready to create the View Controller.
Start by selecting File > New > File from the menu at the top of the screen.
Select Objective-C Class and tap Next.
Enter a Class name. By default, Xcode will attach "ViewController" at the end. Click Next.
Select a Folder to save the View Controller, or just accept the default and click Create. At this point you should see two files ending in .h and .m, see screen shot below.
Your view controller has been created and Xcode is displaying some Objective-C code. Now what? Let's see some other things that are associated with our View Controller that we'll use in other lessons.
Clicking on Main_iPhone.storyboard in the Project Navigator (left-hand panel) will display a hierarchical view your View Controller which you can expand or collapse by clicking on the triangle, see pink arrow in screen shot below. You will also see a visual representation of the view in the middle-right panel. If you don't see this, move the mouse over the middle-right panel and use pinch to zoom in or out until you see the blue box. You may also have to click in the panel and swipe to reposition the blue box in the center of the panel.
So now you've created a view controller and seen some of the tools Xcode provides to manipulate it. In future lessons will discover what we can do with View Controllers.
Credits:
Thanks to Artur Adib, Senior Software Engineer at Twitter, for his help.
This video is a bit different then the article below.
To use a View Controller we need to setup a Project with the following steps. For more detailed instructions, see article on how to Make a Hello World App.
- Start Xcode
- Click on Create a new Xcode project
- Select Single View Application and click Next
- Enter a Product Name and click Next
- Select a folder where you want to save the Project and click Create
Now we are ready to create the View Controller.
Start by selecting File > New > File from the menu at the top of the screen.
Select Objective-C Class and tap Next.
Enter a Class name. By default, Xcode will attach "ViewController" at the end. Click Next.
Select a Folder to save the View Controller, or just accept the default and click Create. At this point you should see two files ending in .h and .m, see screen shot below.
Your view controller has been created and Xcode is displaying some Objective-C code. Now what? Let's see some other things that are associated with our View Controller that we'll use in other lessons.
Clicking on Main_iPhone.storyboard in the Project Navigator (left-hand panel) will display a hierarchical view your View Controller which you can expand or collapse by clicking on the triangle, see pink arrow in screen shot below. You will also see a visual representation of the view in the middle-right panel. If you don't see this, move the mouse over the middle-right panel and use pinch to zoom in or out until you see the blue box. You may also have to click in the panel and swipe to reposition the blue box in the center of the panel.
So now you've created a view controller and seen some of the tools Xcode provides to manipulate it. In future lessons will discover what we can do with View Controllers.
Credits:
Thanks to Artur Adib, Senior Software Engineer at Twitter, for his help.
How to Make a "Hello World" Application and Learn in the Process
Start up by opening your Xcode, create a new project, then hit iOS, application, and hit single view application. You can name it whatever you want but I named it "Hello world" tutorial so that i can remember what it is. Keep the rest of the options the same as when you first saw them. Make sure that these:
settings are selected. These settings are on the bottom of your screen. You can save it wherever you want. Now hit create and Xcode will bring you to a screen with files and lots of confusing things, dont worry about any of it. Now select the Main.storyboard file in the top-left of your screen:
This is a file where you can make screens (or view controllers) where you can put buttons and labels and segues to connect view controllers together. You will already have one view controller there. Now on the bottom right of you screen:
there is a menu where you can drag and drop another view controller onto the storyboard. Go ahead and drag and drop a view controller to the right of the first. Now scroll down in the menu until you find a button and a label. What is cool about this is that you can simply drag a button or label onto a view controller. Now lets drag a label onto the view controller and double click it to type something inside it. I put “Click the Button” because of something were about to do.
Click modal. Now you have just created your first segue!!! This means that when you run your app, if you click on that button it will bring you to the next view controller. Cool, Eh? Heck yeah! Now you can put a label on the second view controller saying, “Hello World!” Lets run it! Just hit the play button at the top of the screen.
You have just created you first app!!! Congradulations!
Subscribe to:
Posts (Atom)