Category: Develop

  • How to only enable portrait orientation for iPhone App

    When developing an iPhone app in Xcode, if you have any requirement that only portrait orientation allowed then you can do the following. Step 1: Open the implementation file for editing. Step 2. Navigate to shouldAutorotateToInterfaceOrientation method. This methods is auto generated by Xcode while creating the project. Step 3: replace the return statement with return (interfaceOrientation == UIInterfaceOrientationPortrait);.…

  • 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…

  • My fiirst program in Objective C using Xcode

    This tutorial is about writing a basic and simple program in Objective C using Xcode. Let us see an example program that prints “My First Program” in the Console Window. Click the File menu on Xcode, then navigate to New -> New Project. This would display the following Choose a template window. Now select Application…