Tuesday, 17 February 2015

Defining and Understanding Variables in ios

Defining and Understanding Variables All modern programming languages, including Objective-C, have the concept of vari‐ ables. Variables are simple aliases to locations in the memory. Every variable can have the following properties: 1. A data type, which is either a primitive, such as an integer, or an object 2. A name 3. A value You don’t always have to set a value for a variable, but you need to specify its type and its name. Here are a few data types that you will need to know about when writing any typical iOS app:

Mutable Versus Immutable If a data type is mutable, you can change if after it is initialized. For instance, you can change one of the values in a mutable array, or add or remove values. In contrast, you must provide the values to an im‐ mutable data type when you initialize it, and cannot add to them, remove them, or change them later. Immutable types are useful be‐ cause they are more efficient, and because they can prevent errors when the values are meant to stay the same throughout the life of the data.
NSInteger and NSUInteger Variables of this type can hold integral values such as 10, 20, etc. The NSInteger type allows negative values as well as positive ones, but the NSUInteger data type is the Unsigned type, hence the U in its name. Remember, the phrase unsigned in programming languages in the context of numbers always means that the number must not be negative. Only a signed data type can hold negative numbers.
CGFloat Holds floating point variables with decimal points, such as 1.31 or 2.40.
NSString Allows you to store strings of characters. We will see examples of this later.
NSNumber Allows you to store numbers as objects.
id Variables of type id can point to any object of any type. These are called untyped objects. Whenever you want to pass an object from one place to another but do not wish to specify its type for whatever reason, you can take advantage of this data type.
NSDictionary and NSMutableDictionary These are immutable and mutable variants of hash tables. A hash table allows you to store a key and to associate a value to that key, such as a key named phone_num that has the value 05552487700. Read the values by referring to the keys associated with them. NSArray and NSMutableArray Immutable and mutable arrays of objects. An array is an ordered collection of items. For instance, you may have 10 string objects that you want to store in memory. An array could be a good place for that. NSSet, NSMutableSet, NSOrderedSet, NSMutableOrderedSet Sets are like arrays in that they can hold series of objects, but they differ from arrays in that they contain only unique objects. Arrays can hold the same object multiple
times, but a set can contain only one instance of an object. I encourage you to learn the difference between arrays and sets and use them properly. NSData and NSMutableData Immutable and mutable containers for any data. These data types are perfect when you want to read the contents of a file, for instance, into memory. Some of the data types that we talked about are primitive, and some are classes. You’ll just have to memorize which is which. For instance, NSInteger is a primitive data type, but NSString is a class, so objects can be instantiated of it. Objective-C, like C and C++, has the concept of pointers. A pointer is a data type that stores the memory address where the real data is stored. You should know by now that pointers to classes are denoted using an asterisk sign: NSString *myString = @"Objective-C is great!"; Thus, when you want to assign a string to a variable of type NSString in Objective-C, you simply have to store the data into a pointer of type NSString *. However, if you are about to store a floating point value into a variable, you wouldn’t specify it as a pointer since the data type for that variable is not a class: /* Set the myFloat variable to PI */ CGFloat myFloat = M_PI; If you wanted to have a pointer to that floating point variable, you could do so as follows: /* Set the myFloat variable to PI */ CGFloat myFloat = M_PI; /* Create a pointer variable that points to the myFloat variable */ CGFloat *pointerFloat = &myFloat; Getting data from the original float is a simple dereference (myFloat), whereas getting the value of through the pointer requires the use of the asterisk (*pointerFloat). The pointer can be useful in some situations, such as when you call a function that sets the value of a floating-point argument and you want to retrieve the new value after the function returns. Going back to classes, we probably have to talk a bit more about classes before things get lost in translation, so let’s do that next.

http://vishal-sata.blogspot.com

Thursday, 12 February 2015

IOS VERSION CODE NAMES


While iOS doesn't enjoy public code-names like OS X - no Snow Leopard or Mountain Lion - they do use internal code names, typically derived from ski resorts. Here a list of previous, current, and future iOS code-names.
1.0: Alpine (1.0.0 - 1.0.2: Heavenly)
1.1: Little Bear (1.1.1: Snowbird, 1.1.2: Oktoberfest)
2.0: Big Bear
2.1: Sugarbowl
2.2: Timberline
3.0: Kirkwood
3.1: Northstar
3.2: Wildcat (iPad only)
4.0: Apex
4.1: Baker
4.2: Jasper (4.2.5 - 4.2.10: Phoenix)
4.3: Durango
5.0: Telluride
5.1: Hoodoo
6.0: Sundance
6.1: Brighton
7.0: Innsbruck
7.1: Sochi
8.0: Okemo
8.1: OkemoTaos
8.2: OkemoZurs
8.3:
8.4:
9.0:
We'll update as new versions are released or otherwise become known.

Wednesday, 11 February 2015

SMALL HISTORY OF IOS

In 2005, when Steve Jobs began planning the iPhone, he had a choice to either "shrink the Mac, which would be an epic feat of engineering, or enlarge the iPod". Jobs favored the former approach but pitted the Macintosh and iPod teams, led by Scott Forstall and Tony Fadell, respectively, against each other in an internal competition, with Forstall winning by creating the iPhone OS. The decision enabled the success of the iPhone as a platform for third-party developers: using a well-known desktop operating system as its basis allowed the many third-party Mac developers to write software for the iPhone with minimal retraining.Forstall was also responsible for creating a software developer's kit for programmers to build iPhone apps, as well as an App Store within iTunes.

The operating system was unveiled with the iPhone at the Macworld Conference & Expo, January 9, 2007, and released in June of that year. At first, Apple marketing literature did not specify a separate name for the operating system, stating simply what Steve Jobs claimed: "iPhone runs OS X" and runs "desktop applications"when in fact it runs a variant of [Mac] OS X, that doesn't run OS X software unless it has been ported to the incompatible operating system. Initially, third-party applications were not supported. Steve Jobs' reasoning was that developers could build web applications that "would behave like native apps on the iPhone".On October 17, 2007, Apple announced that a native Software Development Kit (SDK) was under development and that they planned to put it "in developers' hands in February". On March 6, 2008, Apple released the first beta, along with a new name for the operating system: "iPhone OS".

Apple had released the iPod Touch, which had most of the non-phone capabilities of the iPhone. Apple also sold more than one million iPhones during the 2007 holiday season. On January 27, 2010, Apple announced the iPad, featuring a larger screen than the iPhone and iPod Touch, and designed for web browsing, media consumption, and reading iBooks. In June 2010, Apple rebranded iPhone OS as "iOS". The trademark "IOS" had been used by Cisco for over a decade for its operating system, IOS, used on its routers. To avoid any potential lawsuit, Apple licensed the "IOS" trademark from Cisco.
By late 2011, iOS accounted for 60% of the market share for smartphones and tablet computers.[28] By the end of 2012, iOS accounted for 21% of the smartphone OS market and 43.6% of the tablet OS market.


WHAT IS IOS

iOS (previously iPhone OS) is a mobile operating system developed by Apple Inc. and distributed exclusively for Apple hardware. It is the operating system that powers many of the company's iDevices.
Originally unveiled in 2007 for the iPhone, it has been extended to support other Apple devices such as the iPod Touch (September 2007), iPad (January 2010), iPad Mini (November 2012) and second-generation Apple TV onward (September 2010). As of June 2014, Apple's App Store contained more than 1.2 million iOS applications, 500,000 of which were optimized for iPad. These apps have collectively been downloaded more than 60 billion times. It had a 21% share of the smartphone mobile operating system units shipped in the fourth quarter of 2012, behind Google's Android. By the middle of 2012, there were 410 million devices activated. According to the special media event held by Apple on September 12, 2012, 400 million devices had been sold by June 2012.
The user interface of iOS is based on the concept of direct manipulation, using multi-touch gestures. Interface control elements consist of sliders, switches, and buttons. Interaction with the OS includes gestures such as swipe, tap, pinch, and reverse pinch, all of which have specific definitions within the context of the iOS operating system and its multi-touch interface. Internal accelerometers are used by some applications to respond to shaking the device (one common result is the undo command) or rotating it in three dimensions (one common result is switching from portrait to landscape mode).
iOS shares with OS X some frameworks such as Core Foundation and Foundation; however, its UI toolkit is Cocoa Touch rather than OS X's Cocoa, so that it provides the UIKit framework rather than the AppKit framework. It is therefore not compatible with OS X for applications. Also while iOS also shares the Darwin foundation with OS X, Unix-like shell access is not available for users and restricted for apps, making iOS not fully Unix-compatible either.
Major versions of iOS are released annually. The current release, iOS 8.1.3, was released on January 27, 2015. In iOS, there are four abstraction layers: the Core OS layer, the Core Services layer, the Media layer, and the Cocoa Touch layer. The current version of the operating system (iOS 8.0), dedicates 1.3 - 1.5GB of the device's flash memory for the system partition, using roughly 800 MB of that partition (varying by model) for iOS itself. It runs on the iPhone 4S and later, iPad 2 and later, all models of the iPad Mini, and the 5th-generation iPod Touch.