Articles Tagged 'UIApplication'

Xcode4: backward compatible code

Xcode 4 allows to develop applications for iPhone or iPad with lower target today's iPhone OS 4.3. However the same code that comes with templates "sin" of arrogance, assuming that our application will target iPhone OS 4 or higher. In the application delegate, for example, Xcode inserts the following lines of code:

1
2
3
4
5
6
7
BOOL ) application : ( UIApplication * ) application didFinishLaunchingWithOptions : ( NSDictionary * ) launchOptions - (BOOL) application: (UIApplication *) application didFinishLaunchingWithOptions: ( NSDictionary *) launchOptions
{
/ / Override point for customization after application launch.
self.window.rootViewController = self.viewController;
; [Self.window makeKeyAndVisible];
; return YES;
}

More ...

Common Queue, a simple solution

In asynchronous environments, where method calls or events are released daily bread (see Adobe ActionScript or Objective-C), often the same sequence of operations is not identical to the thousandth of a second. In addition, multiple methods can I call a more general function with the risk to cancel the effect of the other one o'clock.

To clarify the concept a prime example. Environment is often used to activate the iPhone network indicator on the status bar, indicating that there is - precisely - "traffic" network, that you are performing a download or upload (downloading or sending data).

More ...

Use performSelector to pass integer parameters or boolean

The messages (methods) defined in the application (Application delegated) main can be invoked quickly by using performSelector :

1
2
delegate ] [[[UIApplication sharedApplication] delegate]
( applicationMessage ) ] ; performSelector: @ selector (applicationMessage)];

More ...

Objective-C: obtain information from Latitude and Longitude

I answer to Mirko asking me how to make the opposite case proposed in Getting Latitude and Longitude in Objective-C .
Starting from the values ​​of Latitude and Longitude you can use the class MKReverseGeocoder to obtain a range of information, such as: city, state, address in full, chap!

More ...

10 useful tips and snippets for Apple iPhone and Xcode

1. Strings on multiple lines

In Xcode, you can "break" a string across multiple lines by inserting at the end with a backslash "\". This feature can be useful when, for example, we want to insert the HTML text in a control UIWebView :

More ...


Stop SOPA