background preloader

iOS Tuto

Facebook Twitter

MainWindow.xib | YABoW @ trappers.tk. [Update: I added a screencast of the process] [Update: Interesting discussion of this post over on StackOverflow] In the XCode 4.2 beta, MainWindow.xib is no longer included by default in some project templates. This means that you have to get your application to work by writing some code, using another method, or by manually reconstructing MainWindow.xib. This post shows the latter. Let’s get started. If you create a new project in XCode 4.2 beta, and choose the Empty Application template to start from, change nothing and try running it in your iPhone 5.0 simulator, you will see an empty – black – screen.

We will now reconstruct our own MainWindow.xib, to get started with development the way you’re used to. Next, choose iPhone, next give it the name MainWindow (.xib will be added automatically). Select the new File we just created. Change the class of File’s Owner to UIApplication Find Object in the Library and drag it onto the Objects pane on the left. Now, let’s bind it all together. Passage de paramètres entre deux ViewControllers : Delegate & @protocol - Mediabox - Centre de Formation Apple - Ressources. Activez JavaScript pour une utilisation optimale. Introduction Ce tutoriel présente comment faire communiquer deux ViewControllers pour faire passer des paramètres de l'un à l'autre en utilisant le mécanisme de délégation (delegate) et la notion de @protocol. Il va ainsi vous montrer comment créer votre propre @protocol et déclarer un delegate à une de vos classes perso et ainsi utiliser ce mécanisme de delegation pour passer des informations d'un ViewController à un autre Prérequis Pour pouvoir suivre ce tutoriel vous devez déjà connaître les bases de Cocoa et de l'Objective-C et la POO (notions de variable d'instance, etc) ; avoir idéalement déjà créé une application iPhone utilisant des ViewControllers & NavigationControllers vous aidera d'autant plus à suivre ce tutoriel.

Contexte Soit VC1 et VC2 deux classes, disons des ViewControllers, et VC2 veut dialoguer avec VC1 pour lui envoyer (ou lui demander) des informations. Le but de l'opération est donc : Une première solution. How To: Implement Facebook Connect on the iPhone in 5 minutes. Programmez en Objective-C ! Friday Q&A 2011-09-30: Automatic Reference Counting. Friday Q&A 2011-09-30: Automatic Reference Counting Since the moment Apple announced it, readers have asked me to write about Automatic Reference Counting, or ARC. Today is the day.

I'll talk about Apple's new memory management system, how it works, and how to get the most out of it. ConceptualThe Clang static analyzer is a really useful tool for finding memory management errors in code. If you're like me, you've looked at the output of the analyzer and thought, "If you can spot the error, why can't you just fix it for me too? " That, in essence, is what ARC is. The memory management rules are baked into the compiler, but instead of using them to help the programmer find mistakes, it simply inserts the necessary calls on its own. ARC occupies a middle ground between garbage collection and manual memory management. When it comes to implementation specifics, there's another key difference between ARC and Apple's implementation of garbage collection: ARC is not an either/or proposition.