Working with Interface Builder can be spontaneously use an object UIImageView to set the background of our view controller. Alternatively, you can delete this object, thus saving a little 'memory, and take advantage of the view associated with the view controller. Just plug in our view controller:
Category 'iPhone'
Very short snippet: the UIView to display an image
CaptureView: capture a UIView
o UIImageView ) in modo rapido. CaptureView allows you to clone, as an image, any view ( UIView or UIImageView ) quickly. (quindi visualizzato). What you get is an object CaptureView that can be used as a normal UIView (then displayed). Capturing the "screen", or any portion thereof, may be useful in many cases. Once the new "image", it can be manipulated without preoccparsi of its content.
Often you have multiple nested view and Carry out or processing effects on the mother's view that contains them all is not always an optimal solution.
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 of 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).
Variety of coding and coding in Objective-C ...
It was a bit 'that dealt with the subject , so I take this opportunity right away. Here are several ways to accomplish the same result in Objective-C. To you to discover what is the fastest and best!
Reverse an array
1 2 3 4 5 6 7 | / / To be implemented in a category / / Puts the elements of an array in reverse order NSMutableArray * ) reverse { - ( NSMutableArray *) {reverse int i = 0 ; i< ( floor ( [ self count ] / 2.0 ) ) ; i ++ ) for (int i = 0; i <( floor ([self count] / 2.0)) i + +) i withObjectAtIndex : ( [ self count ] - ( i + 1 ) ) ] ; [ExchangeObjectAtIndex self: the withObjectAtIndex: ([self count] - (i + 1))]; return self; } |
10 useful snippets Objective-C
Move the double-tap on the simulator
The simulator iPhones / iPad Xcode allows you to simulate the double tap the Alt key is pressed. This is useful to simulate the function of Pinch, that used to enlarge or scroll Keep away content in the view with objects or UIWebView . Well, some of you have noticed that the simulation of the "two fingers" proceeds in a symmetrical manner always starting from the center of the screen. To move this "center" is also just hold down the SHIFT key.
Objective-C: handle multiple animations with a single setAnimationDidStopSelector
è estremamente versatile, come già visto in setAnimationDidStopSelector: usi diversi ed avanzati . The setting of the end of animation, executed with setAnimationDidStopSelector , a class of UIView is extremely versatile, as seen in setAnimationDidStopSelector: different uses and advanced .
Let me now show you a technique very convenient when we have multiple animations and / or want to manage the queues (queue) of animations.
Objective-C: subclassing and Categories
In Objective-C you can extend a class given in two ways: by running a classic subclassing (see also inheritance) or using the so-called categories .
Note: there is also a third way in Objective-C indicated by the name of Posing we might call a mix of subclass (because it defines a new name) and categories (for a given moment all classes of one type behave like new) .
Very short snippet: a series of images stored in NSUserDefaults
ai dati dell'immagine. To store an image in NSUserDefaults is sufficient to be able to get a pointer NSData image data. In this way we could rebuild our image at any time thereafter.
In the example shown below is used an array that contains a maximum of 4 images. Each new image is put on the head and the excess removed.
How to develop in PHP with Xcode and Objective-C
How many programmers to use, I also build my own library of functions ready to be reused in multiple projects and multiple contexts. Let me change the title of this post, maybe a little 'risky but, nevertheless, as we shall see, not far from reality.
In Objective-C you can write and call C / C + +, including the assembly for that matter. This characteristic makes it a very versatile language and, in some respects, phenomenal. On the one hand, you can use and appreciate the purely syntax of Objective-C, on the other you can run faster porting code written in ANSI C (perhaps for Digital Unix or Sun) and can comfortably fit into our iPhone or iPad applications; not to mention all the BSD kernel is already available on Mac OS X!
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:







Latest Comments
Simon : It annoys disturbed again and use that space for these things ... however it does not work ...
Giovambattista Fazioli : @ Simon: what could be due to the syntax I used, specifically for PHP 5 +,...
Simon : I tried last night putting everything into functions.php, okay, jquery forms, and tabs jQueryUI them ...
Giovambattista Fazioli : @ Simon: I recommend cleaning to enter a code like that in ...
Simon : @ Giovambattista Fazioli: Thank you for your patience, it's all clear ... now I feel now, ...