Category 'Objective-C'


Objective-C: Addendum on notifications and delegates

Answer to the question of ILeW with an article to better explain itself, enclosing instance , work as delegates and notifications. Using a pattern we see first how the delegate pattern:

Delegate

An object in search of a delegate

More ...

With multiple video AVQueuePlayer

The class MPMoviePlayerController has the big drawback of not adequately manage more contemporary videos, in addition to making it difficult to create a sequence of video one after the other. che è una sottoclasse di AVPlayer ), appartenente al framework più a basso livello AVFoundation , è invece estremamente più versatile, nonostante mantenga egualmente una semplicità nell'implementazione. The class AVPlayer (or AVQueuePlayer which is a subclass of AVPlayer ) belonging to the lower-level framework AVFoundation , but is extremely versatile, equally despite maintaining simplicity in implementation.

Frameworks Block Diagram

More ...

Objective-C: how to best use the property list file

One of the advantages of the Property list files, which are simply text files that follow the XML standard, is that it can be instantly transformed into objects (as an array or dictionary) Objective-C. When you create a file list Property:

Property List

More ...

Very short trick: log JavaScript objects

If you are to develop in an environment where it is impossible to use debugging tools like FireBug , such as the Apple iPhone simulator in Xcode, it can become frustrating to find problems, including an incorrect access to all the properties of an object. Here the use of works alert() is fundamental!

More ...

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

Objective-C: Notifications and Delegates

In Objective-C we have two very used to receive and send messages between classes: the notifications and delegates. The difference between the two, besides being at the implementation level, substantially depends on "how" - objects - can receive a message. First let me show how the concept was born of delegate.

More ...

Very short snippet: NSConnection POST with parameters

che in modalità POST . The object NSMutableURLRequest can be utilized either as GET that mode POST . . The parameters, however, must be formatted as if they are GET , ie in the sequence nome_campo1=valore1&nome_campo2=valore2&... . Here is a useful snippets to simplify the construction of fields:

More ...

Objective-C: public, protected, and private

I wrote a similar article for ActionScript long ago: Actionscript 3.0: public, protected, private and internal . Rereading it I realized two things: the first was the extreme resemblance to Objective-C, although the latter does not include internal .

More ...

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



Stop SOPA