Category 'D'


iPhone FontsBook: source code to display the system font

Rounding out the article How to: Custom fonts on iPhone OS 3. 2 we propose the sources FontsBook , a simple iPhone application that shows a table all system fonts, grouped by family.

FontsBookFontsBookFontsBook

More ...

Very short trick: how to use NSFileManager

, in quanto quest'ultimo restituisce un'instanza singleton, cioè sempre lo stesso puntatore ad oggetto (non thread safe). Apple recommends using the object instance NSFileManager and not its meotodo class defaultManager , as the latter returns an instance singleton, that is always the same pointer to the object (not thread safe).

More ...

How to: Custom fonts on iPhone OS 3.2

With release 3.2 of IOS you can include in their application font resources, to use as those provided exactly is the system:

file. Applications That want to use custom fonts can now include fonts Those In Their application and register Those fonts bundled with the system by Including the UIAppFonts Their key in Info.plist file. The value of this key is an array of strings Identifying the font files in the application's bundle. When the system sees the key, it loads the specified fonts and Makes Them available to the application.

More ...

Coding Guidelines

When no longer working alone for all developers comes time to find some guidelines in writing code. Protocols and standards to allow "read" easily and intervene (more easily) in the code of others.
When we are working on a project more programmers, often of different languages, it is mandatory to find a common form of writing standards in internal and external documentation to your code. In my work I'm normally interact with:

  • Objetive-C, C / C + +
  • PHP
  • HTML
  • Javascript
  • Actionscript
  • CSS

More ...

PhpStorm 2.0

PHP IDE dedicated to the development there are many, ranging from free to paid ones. For a long time I have used tools such as Eclipse or Aptana , coming to serve a specialized editor with HTML / Javascript, and - even - CSS. For a year now, however, I think I found definitivamento a complete environment that, at least in my case, it solves all my problems: PhpStorm .

More ...

Very short snippet: the UIView to display an image

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 exploit the view associated with the view controller. Just plug in our view controller:

More ...

CaptureView: capture a UIView

o UIImageView ) in modo rapido. CaptureView allows to clone, in the form of image, any view ( UIView or UIImageView ) quickly. (quindi visualizzato). What is obtained is an object CaptureView that can be used as a normal UIView (then displayed). Capturing the "screen", or a 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 THET effects or transformations on the view that the parent contains all is not always an optimal solution.

More ...

jQuery snippets

Verify the existence of an element in the DOM

It would happen that it must establish the existence of an element of the DOM. With jQuery could be spontaneously try:

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 ...

Variety of coding and coding in Objective-C ...

It was a bit 'that was treating the topic , so I take this opportunity immediately. 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 ) ) ] ; [Self exchangeObjectAtIndex: the withObjectAtIndex: ([self count] - (i + 1))];
return self;
}

More ...



Stop SOPA