Category 'Objective-C'


Objective-C: how to rotate an image in 3D space

), un oggetto di più basso livello con innumerevoli potenzialità. The class UIView displays a pointer to the layer ( CALayer ), an object of the lower level with vast potential. The layer provides a variety of methods and properties related to displaying the contents of the view. For example, you can manipulate the contents of a view in three dimensional space. In ' sample carryover is interesting to note that the code is simple, and everything is created using Interface Builder:

Continued ...

Very short snippet: detect iPad on the device and on the Web

Not only browsers portatitli desktop or browsing the sites developed by us, now the era of mobile - the mobile browser - is widespread, thanks to devices like the Apple iPhone, Android, etc ... Furthermore, even for developers for the Apple iPhone has become mandatory to understand to which device the application is running.

On the Web, the situation is similar to that displayed in the Browser or Mobile Browser? , with the variant:

Continued ...

Private APIs in the removal of the scroll in a UIWebView object

In Very short snippet: Remove scroll from a UIWebView object we saw how it was possible to remove the scroll from an object UIWebView :

Continued ...

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)];

Continued ...

Connect to Foursquare via ASIHTTPRequest

Foursquare allows through its API to access a range of features (many in this version 1) directly from our iPhone apps. We see, therefore, how to integrate access to Foursquare in Objective-C using the known framework ASIHTTPRequest to perform basic authentication.

Continued ...

Objective-C: obtain information from Latitude and Longitude

I respond 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!

Continued ...

UIWebView: catch the opening of a Link

The object UIWebView component is a very useful and versatile, ideal for solving many problems. Not only is perfect to display an HTML page on the net, but you can use it for other useful purposes such as:

  • Quickly display PDF documents
  • View videos or pictures
  • Display content HTML / CSS local
  • Contained in the prototype stage fake ...

Continued ...

UIImage: useful snippets

, sono molto utilizzati nello sviluppo di applicazioni per Apple iPhone. The object of UIImage , along with UIImageView , are widely used in developing applications for Apple iPhone. Here is some useful code snippet-make a set of common processing:

Combining two (or more) images

1
2
3
4
5
6
7
8
9
10
11
12
UIImage * ) combineImage : ( UIImage * ) imageA imageB : ( UIImage * ) imageB { - (UIImage *) combineImage: (UIImage *) Imageo imageB: (UIImage *) {imageB
; UIGraphicsBeginImageContext (imageA.size);

CGRectMake ( 0 , 0 , imageA.size.width, imageA.size.height ) ] ; [Imageo drawInRect: CGRectMake (0, 0, imageA.size.width, imageA.size.height)];
CGRectMake ( 0 , 0 , imageB.size.width, imageB.size.height ) ] ; [ImageB drawInRect: CGRectMake (0, 0, imageB.size.width, imageB.size.height)];

UIGraphicsGetImageFromCurrentImageContext ( ) ; UIImage * combinatedImage UIGraphicsGetImageFromCurrentImageContext = ();

UIGraphicsEndImageContext ();

combinatedImage return;
}

Continued ...

Very short snippet: Remove scroll from one object to UIWebView

Documented or undocumented, a feature, sometimes, you are forced to implement by force! Useful in some situations, the scroll is to remove an object from UIWebView . : Interestingly, in general, see how you can access the components 'internal' part of the object in question: in this example retrieves the object pointer UIScrollView present in the subject UIWebView :

Continued ...

Very short snippet: NSURL, and various possible

Returns the name of a file from the object NSURLRequest , allowing you to decide whether or not its extension:

Continued ...



Stop SOPA