Category: ios

  • How to change page scaling in Xcode

    Xcode provides option to increase or decrease the page scaling. This page scaling option is available as part of the Page Setup. This feature is quite useful when you want reduce the number of pages used for printing any Objective-C code. The default page scale is set to 100% and you can change this by…

  • What is Delegation in iOS ?

    Delegation is one of the commonly used pattern in iOS. This is used tell an object to act on behalf of another. Refer to Apple documentation for detailed information on delegate pattern. Let us see this with an example program that uses UITextFieldDelegate. This is a SingleView Project with one UITextField control. #import “ViewController.h” @interface…

  • Different ways to connect IBAction to UIButton

    In this tutorial, we are going to see the different ways for connecting IBAction to UIButton. Let see this with an example that displays an alert message on the touch event of UiButton. Method 1 (Assistant Editor): Step 1: Drag and drop Round Rect Button from the Objects library on to Interface builder. Step 2:…

  • XCode’s iOS Simulator for iPhone and iPad

    iOS Simulator in Xcode can be used for testing iOS apps before trying the apps on a live device. Listed below are the different settings and features on iOS Simulator. Launching iOS Simulator iOS Simulator can be launched by executing Program on Xcode Run Program on Xcode : Keyboard Shortcut is Command + R, Menu…

  • Provisioning iPhone 4S for deploying and testing Apps

    Listed below are detail steps for provisioning iPhone 4S for deploying and testing Apps. The steps have been broadly classified in to the following topics. Requesting Development Certificate Submit Certificate in iOS Provisioning Portal Installing Certificate Registering Device to Provisioning Portal Requesting Development Certificate Requesting development certificate requires you to generate a Certificate Signing Request…

  • Code Example – Check for Prime Number Objective C

    This is a simple Objective C program written to check whether a number is a Prime number. // // main.m // PrimeNumbers // // Created by Ravi Shankar on 10/02/12. // Copyright (c) 2012 rshankar.com. All rights reserved. // #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { @autoreleasepool {    int number;…

  • iPad App that prints Welcome Message

    Here is an example of writing an iPad app that prints a Welcome message. Launch Xcode, click File -> New -> New Project. Now select the template for the project as Single View Application. Provide the details for your project, like Product Name, Company Name then choose the device for which you are writing the…

  • Dissecting Objective-C program

    We have already seen couple of examples in Objective-C like writing your first program in Objective-C and adding Objective-C classes. Now let us try and analyze the code to learn basic coding on Objective-C program. Adding Comments The very basic thing to learn is any programming language is “how to add comments”. In Objective-C you…