Archive

Archive for the ‘iPhone’ Category

A Word about first iPhone Application

October 16th, 2009 volody No comments

After installing iPhone Developer SDK is required to find a Xcode application. Xcode can be found following a disk icon on right up corner of Mac desktop. In Open dialog follow Developer folder then Applications folder and the finally Xcode.
Developer could use Apple Creating an iPhone Application guide as next step to build the first sample project MoveMe. Project code can be downloaded from Apple. “Although iPhone OS has a virtual memory system, but it does not use a swap file. This means that code pages can be flushed as needed but iPhone application’s data must all fit into memory at the same time. The system monitors the overall amount of free memory and does what it can to give iPhone application the memory it needs. If memory usage becomes too critical though, the system may terminate iPhone application.”

Categories: iPhone Tags:

NSObject as a base class in iPhone SDK

October 15th, 2009 volody No comments

The NSObject protocol groups methods (NS stands for NEXTSTEP) are fundamental to all Objective-C objects. In Mac OS X v10.5 and later, developer can use automatic memory management by adopting garbage collection, as it described in Garbage Collection Programming Guide.

A simple Window-Based Application iPhone app could be created in XCode, with next code right after line :
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

NSObject *obj; // declare variable
obj = [NSObject alloc]; // allocate variable
[obj init]; // initialize variable
NSLog(@”Option 2:%@\n”, obj); // output variable declaration into console

This NSLog output is sent to Console. To test this code goto Run -> Console -> Build and Go.

Categories: iPhone Tags: