Xcode 4.5
XCODE 4.5
 Nicolas Lauquin - L’atelier du mobile




8 novembre 2012 @ CocoaHeads
Xcode 4.5
pense, crée et fait connaitre vos applications mobiles
INTRODUCTION
• Chronologie     d’Xcode 4.x & fonctionnalités clefs

• Améliorations    d’Objective C

• Démo

• Les   impacts & architectures supportées



Note : présentation orientée iOS
(R)EVOLUTION D’XCODE 4.0
     MARS 2011 (PUBLIC RELEASE)
(R)EVOLUTION D’XCODE 4.0
                 MARS 2011 (PUBLIC RELEASE)




•   Présentations «Hello Xcode 4» Cocoaheads du 14 avril 2011
(R)EVOLUTION D’XCODE 4.0
                     MARS 2011 (PUBLIC RELEASE)




•   Présentations «Hello Xcode 4» Cocoaheads du 14 avril 2011

    •   «Un outil attendu (instable ? ;-))»
(R)EVOLUTION D’XCODE 4.0
                     MARS 2011 (PUBLIC RELEASE)




•   Présentations «Hello Xcode 4» Cocoaheads du 14 avril 2011

    •   «Un outil attendu (instable ? ;-))»

    •   «Une modification du processus de développement»
(R)EVOLUTION D’XCODE 4.0
                     MARS 2011 (PUBLIC RELEASE)




•   Présentations «Hello Xcode 4» Cocoaheads du 14 avril 2011

    •   «Un outil attendu (instable ? ;-))»

    •   «Une modification du processus de développement»

    •   «Des fonctionnalités perdues & des évolutions»
EVOLUTION XCODE 4.1
      JUILLET 2011
EVOLUTION XCODE 4.1
                         JUILLET 2011



•   Support de Mac OS X LION (10.7)
EVOLUTION XCODE 4.1
                         JUILLET 2011



•   Support de Mac OS X LION (10.7)

•   Autolayout (Lion)
EVOLUTION XCODE 4.1
                         JUILLET 2011



•   Support de Mac OS X LION (10.7)

•   Autolayout (Lion)

•   OS X Application Sandbox (Lion)
EVOLUTION XCODE 4.1
                         JUILLET 2011



•   Support de Mac OS X LION (10.7)

•   Autolayout (Lion)

•   OS X Application Sandbox (Lion)

•   Default compiler LLVM-GCC 4.2
EVOLUTION XCODE 4.1
                         JUILLET 2011



•   Support de Mac OS X LION (10.7)

•   Autolayout (Lion)

•   OS X Application Sandbox (Lion)

•   Default compiler LLVM-GCC 4.2

•   Custom Behaviors
EVOLUTION XCODE 4.1
                         JUILLET 2011



•   Support de Mac OS X LION (10.7)

•   Autolayout (Lion)

•   OS X Application Sandbox (Lion)

•   Default compiler LLVM-GCC 4.2

•   Custom Behaviors

•   Git Remote Management
EVOLUTION XCODE 4.2
      OCTOBRE 2011
EVOLUTION XCODE 4.2
                    OCTOBRE 2011



•   Support iOS 5
EVOLUTION XCODE 4.2
                    OCTOBRE 2011



•   Support iOS 5

•   ARC
EVOLUTION XCODE 4.2
                        OCTOBRE 2011



•   Support iOS 5

•   ARC

•   Default compiler LLVM 3.0
EVOLUTION XCODE 4.2
                        OCTOBRE 2011



•   Support iOS 5

•   ARC

•   Default compiler LLVM 3.0

•   Storyboarding
EVOLUTION XCODE 4.2
                          OCTOBRE 2011



•   Support iOS 5

•   ARC

•   Default compiler LLVM 3.0

•   Storyboarding

•   Location Simulation
EVOLUTION XCODE 4.2
                          OCTOBRE 2011



•   Support iOS 5

•   ARC

•   Default compiler LLVM 3.0

•   Storyboarding

•   Location Simulation

•   Dernière version compatible Snow Leopard
EVOLUTION XCODE 4.3
       MARS 2012
EVOLUTION XCODE 4.3
                           MARS 2012




•   Une application “tout en un“ téléchargeable depuis le Mac
    AppStore. Bybye «/Developer»
EVOLUTION XCODE 4.3
                           MARS 2012




•   Une application “tout en un“ téléchargeable depuis le Mac
    AppStore. Bybye «/Developer»

•   Auto Layout est par défaut pour tout projet Cocoa
EVOLUTION XCODE 4.3
                               MARS 2012




•   Une application “tout en un“ téléchargeable depuis le Mac
    AppStore. Bybye «/Developer»

•   Auto Layout est par défaut pour tout projet Cocoa

•   Xcode 4.3.1 -> support iOS5.1
EVOLUTION XCODE 4.3
                               MARS 2012




•   Une application “tout en un“ téléchargeable depuis le Mac
    AppStore. Bybye «/Developer»

•   Auto Layout est par défaut pour tout projet Cocoa

•   Xcode 4.3.1 -> support iOS5.1

•   Xcode 4.3.3 -> maj pour 10.7.4
EVOLUTION XCODE 4.4
      JUILLET 2012
EVOLUTION XCODE 4.4
                           JUILLET 2012


•   Support de Mountain Lion (10.8)
EVOLUTION XCODE 4.4
                           JUILLET 2012


•   Support de Mountain Lion (10.8)

•   Fonctionne sur Mac OS X Lion et Mountain Lion
EVOLUTION XCODE 4.4
                            JUILLET 2012


•   Support de Mountain Lion (10.8)

•   Fonctionne sur Mac OS X Lion et Mountain Lion

•   LLVM 4.0 Compiler màj (literals & subscription) - OS X
EVOLUTION XCODE 4.4
                            JUILLET 2012


•   Support de Mountain Lion (10.8)

•   Fonctionne sur Mac OS X Lion et Mountain Lion

•   LLVM 4.0 Compiler màj (literals & subscription) - OS X

•   Synthesize par défaut pour les properties
EVOLUTION XCODE 4.4
                            JUILLET 2012


•   Support de Mountain Lion (10.8)

•   Fonctionne sur Mac OS X Lion et Mountain Lion

•   LLVM 4.0 Compiler màj (literals & subscription) - OS X

•   Synthesize par défaut pour les properties

•   Amélioration de l’«analyzer»   (common security mistakes in API and malloc
    usages)
EVOLUTION XCODE 4.4
                                 JUILLET 2012


•   Support de Mountain Lion (10.8)

•   Fonctionne sur Mac OS X Lion et Mountain Lion

•   LLVM 4.0 Compiler màj (literals & subscription) - OS X

•   Synthesize par défaut pour les properties

•   Amélioration de l’«analyzer»      (common security mistakes in API and malloc
    usages)

•   4.4.1 -> avec correction de quelques bugs
EVOLUTION XCODE 4.5
     SEPTEMBRE 2012
EVOLUTION XCODE 4.5
                   SEPTEMBRE 2012

•   iOS6 support
EVOLUTION XCODE 4.5
                        SEPTEMBRE 2012

•   iOS6 support

•   Écran 4“ Retina de l’iPhone 5 & iPod
EVOLUTION XCODE 4.5
                        SEPTEMBRE 2012

•   iOS6 support

•   Écran 4“ Retina de l’iPhone 5 & iPod

•   Support des literals & subscripting pour iOS
EVOLUTION XCODE 4.5
                          SEPTEMBRE 2012

•   iOS6 support

•   Écran 4“ Retina de l’iPhone 5 & iPod

•   Support des literals & subscripting pour iOS

•   Autolayout pour iOS
EVOLUTION XCODE 4.5
                          SEPTEMBRE 2012

•   iOS6 support

•   Écran 4“ Retina de l’iPhone 5 & iPod

•   Support des literals & subscripting pour iOS

•   Autolayout pour iOS

•   LLDB is now the default debugger & LLDB supports hardware
    watchpoints on iOS devices
EVOLUTION XCODE 4.5
                                SEPTEMBRE 2012

•   iOS6 support

•   Écran 4“ Retina de l’iPhone 5 & iPod

•   Support des literals & subscripting pour iOS

•   Autolayout pour iOS

•   LLDB is now the default debugger & LLDB supports hardware
    watchpoints on iOS devices

•   Xcode 4.5.1 (octobre) -> bug fix & stabilité
EVOLUTION XCODE 4.5
                                SEPTEMBRE 2012

•   iOS6 support

•   Écran 4“ Retina de l’iPhone 5 & iPod

•   Support des literals & subscripting pour iOS

•   Autolayout pour iOS

•   LLDB is now the default debugger & LLDB supports hardware
    watchpoints on iOS devices

•   Xcode 4.5.1 (octobre) -> bug fix & stabilité

•   Xcode 4.5.2 (novembre) -> support de l’iPad mini & iPad écran retina
AMÉLIORATION D’OBJECTIVE C
SIMPLIFICATION : ORDRE DES MÉTHODES 1/5
AMÉLIORATION D’OBJECTIVE C
       SIMPLIFICATION : ORDRE DES MÉTHODES 1/5


#import "CocoaheadsMeetingViewController.h"


@implementation CocoaheadsMeetingViewController

- (void)listeningThePresentation {
    [self carefully];
}

- (void)carefully {}


@end
AMÉLIORATION D’OBJECTIVE C
        SIMPLIFICATION : ORDRE DES MÉTHODES 1/5


 #import "CocoaheadsMeetingViewController.h"


 @implementation CocoaheadsMeetingViewController

 - (void)listeningThePresentation {
     [self carefully];
 }

 - (void)carefully {}


 @end




Avant Xcode 4.4 -> warning méthode non trouvée
AMÉLIORATION D’OBJECTIVE C
SIMPLIFICATION : ORDRE DES MÉTHODES 2/5
AMÉLIORATION D’OBJECTIVE C
        SIMPLIFICATION : ORDRE DES MÉTHODES 2/5

Solution 1) Ordonnancer les méthodes
 #import "CocoaheadsMeetingViewController.h"

 @implementation CocoaheadsMeetingViewController


 - (void)carefully {}

 - (void)listeningThePresentation {
     [self carefully];
 }

 @end
AMÉLIORATION D’OBJECTIVE C
        SIMPLIFICATION : ORDRE DES MÉTHODES 2/5

Solution 1) Ordonnancer les méthodes
 #import "CocoaheadsMeetingViewController.h"

 @implementation CocoaheadsMeetingViewController


 - (void)carefully {}

 - (void)listeningThePresentation {
     [self carefully];
 }

 @end


Analyse :
• ne fonctionne pas tout le temps
• surtout une perte de temps
AMÉLIORATION D’OBJECTIVE C
SIMPLIFICATION : ORDRE DES MÉTHODES 3/5
AMÉLIORATION D’OBJECTIVE C
     SIMPLIFICATION : ORDRE DES MÉTHODES 3/5

Solution 2) Classe publique
AMÉLIORATION D’OBJECTIVE C
        SIMPLIFICATION : ORDRE DES MÉTHODES 3/5

Solution 2) Classe publique

 @interface CocoaheadsMeetingViewController : UIViewController
    - (void)carefully;
 @end

 @implementation CocoaheadsMeetingViewController

 - (void)listeningThePresentation {
     [self carefully];
 }

 - (void)carefully {}

 @end
AMÉLIORATION D’OBJECTIVE C
        SIMPLIFICATION : ORDRE DES MÉTHODES 3/5

Solution 2) Classe publique

 @interface CocoaheadsMeetingViewController : UIViewController
    - (void)carefully;
 @end

 @implementation CocoaheadsMeetingViewController

 - (void)listeningThePresentation {
     [self carefully];
 }

 - (void)carefully {}

 @end

Analyse :
• mauvaise exposition/programmation
AMÉLIORATION D’OBJECTIVE C
SIMPLIFICATION : ORDRE DES MÉTHODES 4/5
AMÉLIORATION D’OBJECTIVE C
     SIMPLIFICATION : ORDRE DES MÉTHODES 4/5

Solution 3) Extension de classe
AMÉLIORATION D’OBJECTIVE C
        SIMPLIFICATION : ORDRE DES MÉTHODES 4/5

Solution 3) Extension de classe
 @interface CocoaheadsMeetingViewController ()

 - (void)carefully;

 @end

 @implementation CocoaheadsMeetingViewController

 - (void)listeningThePresentation {
     [self carefully];
 }

 - (void)carefully {}
AMÉLIORATION D’OBJECTIVE C
        SIMPLIFICATION : ORDRE DES MÉTHODES 4/5

Solution 3) Extension de classe
 @interface CocoaheadsMeetingViewController ()

 - (void)carefully;

 @end

 @implementation CocoaheadsMeetingViewController

 - (void)listeningThePresentation {
     [self carefully];
 }

 - (void)carefully {}

Analyse :
• permet l’ajout de “property“ privées & méthodes accessibles depuis un nib
• reste une perte de temps & un workaround
AMÉLIORATION D’OBJECTIVE C
SIMPLIFICATION : ORDRE DES MÉTHODES 5/5
AMÉLIORATION D’OBJECTIVE C
     SIMPLIFICATION : ORDRE DES MÉTHODES 5/5

Solution 4)
AMÉLIORATION D’OBJECTIVE C
     SIMPLIFICATION : ORDRE DES MÉTHODES 5/5

Solution 4)




 Ça fonctionne tout simplement dans Xcode 4.5
AMÉLIORATION D’OBJECTIVE C
                    AMÉLIORATION : ENUM

Enum with fixed underlying type



 typedef enum CocoaheadsPublicType : NSUInteger {
     CocoaheadsPublicDevelopper,
     CocoaheadsPublicDesigner,
     CocoaheadsPublicPM
 } CocoaheadsPublicType;




  Analyse :
  • enumération typées
  • Warning type checking
  • Warning handeling all enums values
AMÉLIORATION D’OBJECTIVE C
     SIMPLIFICATION : PROPERTIES
AMÉLIORATION D’OBJECTIVE C
                       SIMPLIFICATION : PROPERTIES

   @interface PropertyObject : NSObject
   @property (readwrite, strong) NSString * name;
   @end

   @implementation PropertyObject

   @end


Analyse :
•“synthesize“ par défaut
•chaque accesseur est généré si non fourni
AMÉLIORATION D’OBJECTIVE C
                        SIMPLIFICATION : PROPERTIES

   @interface PropertyObject : NSObject
   @property (readwrite, strong) NSString * name;
   @end

   @implementation PropertyObject
   @synthesize name = _name;// generated by default
   @end


Analyse :
•“synthesize“ par défaut
•chaque accesseur est généré si non fourni
•variable d’instance généré par défaut “_variable“ si non fournie
AMÉLIORATION D’OBJECTIVE C
                        SIMPLIFICATION : PROPERTIES

   @interface PropertyObject : NSObject
   @property (readwrite, strong) NSString * name;
   @end

   @implementation PropertyObject
   @synthesize name = _name;// generated by default
   @end


Analyse :
•“synthesize“ par défaut
•chaque accesseur est généré si non fourni
•variable d’instance généré par défaut “_variable“ si non fournie
•compatibilité :
LITERALS 1/6
    INTRO
LITERALS 1/6
                      INTRO




•   Code allégé
LITERALS 1/6
                        INTRO




•   Code allégé

•   Gain de temps
LITERALS 1/6
                               INTRO




•   Code allégé

•   Gain de temps

•   “boxing“ : primitive value to object. (Necessary for Foundation
    collections)
LITERALS 2/6
NSNUMBER - BOXED NUMBER
LITERALS 2/6
                  NSNUMBER - BOXED NUMBER




•   [NSNumber numberWithInt:42];
LITERALS 2/6
                  NSNUMBER - BOXED NUMBER




•   [NSNumber numberWithInt:42];            -> @42
LITERALS 2/6
                  NSNUMBER - BOXED NUMBER




•   [NSNumber numberWithInt:42];            -> @42


•   [NSNumber numberWithBool:YES];
LITERALS 2/6
                  NSNUMBER - BOXED NUMBER




•   [NSNumber numberWithInt:42];            -> @42


•   [NSNumber numberWithBool:YES];          -> @YES
LITERALS 2/6
                  NSNUMBER - BOXED NUMBER




•   [NSNumber numberWithInt:42];               -> @42


•   [NSNumber numberWithBool:YES];             -> @YES


•   [NSNumber numberWithFloat:3.141592654F];
LITERALS 2/6
                  NSNUMBER - BOXED NUMBER




•   [NSNumber numberWithInt:42];               -> @42


•   [NSNumber numberWithBool:YES];             -> @YES


•   [NSNumber numberWithFloat:3.141592654F]; -> @3.141592654F;
LITERALS 3/6
BOXED EXPRESSIONS
LITERALS 3/6
                            BOXED EXPRESSIONS

Syntaxe : @( expression )
LITERALS 3/6
                            BOXED EXPRESSIONS

Syntaxe : @( expression )

•   1) Numbers
LITERALS 3/6
                               BOXED EXPRESSIONS

Syntaxe : @( expression )

•   1) Numbers

    •   NSNumber *piOverTwo = @(M_PI / 2); // [NSNumber numberWithDouble:(M_PI / 2)]
LITERALS 3/6
                                   BOXED EXPRESSIONS

Syntaxe : @( expression )

•   1) Numbers

    •   NSNumber *piOverTwo = @(M_PI / 2); // [NSNumber numberWithDouble:(M_PI / 2)]

•   2) Enumerated types :

    •   typedef enum { Red, Green, Blue } Color;

    •   NSNumber *favoriteColor = @(Green);        // [NSNumber numberWithInt:((int)Green)]
LITERALS 3/6
                                    BOXED EXPRESSIONS

Syntaxe : @( expression )

•   1) Numbers

     •   NSNumber *piOverTwo = @(M_PI / 2); // [NSNumber numberWithDouble:(M_PI / 2)]

•   2) Enumerated types :

    •    typedef enum { Red, Green, Blue } Color;

    •    NSNumber *favoriteColor = @(Green);        // [NSNumber numberWithInt:((int)Green)]
•   3) Strings :

    •    NSString *path = @(getenv("PATH"));    // [NSString stringWithUTF8String:(getenv("PATH"))]

    •    NSArray *pathComponents = [path componentsSeparatedByString:@":"];
LITERALS 4/6
  DICTIONARY
LITERALS 4/6
                              DICTIONARY




•   NSDictionnary *dict = [NSDictionnary
    dictionnaryWithObjectsAndKeys:{"val1", "key1", "val2", "key2"};
LITERALS 4/6
                              DICTIONARY




•   NSDictionnary *dict = [NSDictionnary
    dictionnaryWithObjectsAndKeys:{"val1", "key1", "val2", "key2"};

•   NSDictionnary *dict = @{ @"key1":@"val1", @"key2":@"val2" };
LITERALS 4/6
                               DICTIONARY




•   NSDictionnary *dict = [NSDictionnary
    dictionnaryWithObjectsAndKeys:{"val1", "key1", "val2", "key2"};

•   NSDictionnary *dict = @{ @"key1":@"val1", @"key2":@"val2" };

•   Syntaxe @{key : obj, … }
LITERALS 4/6
                               DICTIONARY




•   NSDictionnary *dict = [NSDictionnary
    dictionnaryWithObjectsAndKeys:{"val1", "key1", "val2", "key2"};

•   NSDictionnary *dict = @{ @"key1":@"val1", @"key2":@"val2" };

•   Syntaxe @{key : obj, … }

•   -> Attention cohérence
LITERALS 5/6
    ARRAY
LITERALS 5/6
                                ARRAY




•   NSArray *ar = [NSArray arrayWithObjects:@"titi", @"toto", nil];
LITERALS 5/6
                                ARRAY




•   NSArray *ar = [NSArray arrayWithObjects:@"titi", @"toto", nil];

•   NSArray *ar = @[@"titi", @"toto"];
LITERALS 5/6
                                ARRAY




•   NSArray *ar = [NSArray arrayWithObjects:@"titi", @"toto", nil];

•   NSArray *ar = @[@"titi", @"toto"];

•   Syntaxe : @[obj1, obj2]
LITERALS 5/6
  CONTAINER
LITERALS 5/6
                            CONTAINER



•   Container sont “immutable“
LITERALS 5/6
                                  CONTAINER



•   Container sont “immutable“

•   Utiliser : “-mutableCopy“
      NSMutableArray * numberArray = [@[ @"one", @"two", @"three"]mutableCopy];
LITERALS 5/6
                                  CONTAINER



•   Container sont “immutable“

•   Utiliser : “-mutableCopy“
      NSMutableArray * numberArray = [@[ @"one", @"two", @"three"]mutableCopy];


•   Usage static : «Initializer element is not a compile-time constant»
LITERALS 5/6
                                    CONTAINER



•   Container sont “immutable“

•   Utiliser : “-mutableCopy“
        NSMutableArray * numberArray = [@[ @"one", @"two", @"three"]mutableCopy];


•   Usage static : «Initializer element is not a compile-time constant»

    •   workaround : affecter la valeur dans la méthode “+initialize“ de
        votre classe
OBJECT SUBSCRIPTING 1/3

Array (index subscripting)
NSMutableArray *array = ...;
NSUInteger idx = ...;
id newObject = ...;
id oldObject = array[idx];
array[idx] = newObject;! !     // replace oldObject with newObject
OBJECT SUBSCRIPTING 1/3

Array (index subscripting)
NSMutableArray *array = ...;
NSUInteger idx = ...;
id newObject = ...;
id oldObject = array[idx];
array[idx] = newObject;! !       // replace oldObject with newObject



Dictionnary (key subscripting)
NSMutableDictionary *dictionary = ...;
NSString *key = ...;
oldObject = dictionary[key];
dictionary[key] = newObject;!// replace oldObject with newObject
OBJECT SUBSCRIPTING 2/3
       DÉCRYPTAGE
OBJECT SUBSCRIPTING 2/3
                          DÉCRYPTAGE

Array
id value = array[idx]; -> id value = [array objectAtIndexedSubscript:idx];
array[idx] = object; -> [array setObject:object atIndexedSubscript:idx];

idx : integral type
object : object pointer
OBJECT SUBSCRIPTING 2/3
                          DÉCRYPTAGE

Array
id value = array[idx]; -> id value = [array objectAtIndexedSubscript:idx];
array[idx] = object; -> [array setObject:object atIndexedSubscript:idx];

idx : integral type
object : object pointer




Dictionnary
id value = dict[key]; -> id value = [dict objectForKeyedSubscript:key];
dict[key] = object; -> [dict setObject:object forKeyedSubscript:key];


key & object : object pointer
OBJECT SUBSCRIPTING 3/3
 VOTRE CLASSE “SUBSCRIPTABLE“
OBJECT SUBSCRIPTING 3/3
              VOTRE CLASSE “SUBSCRIPTABLE“
@interface MyCocoaheadsList : NSObject

- (User *) objectAtIndexedSubscript:(NSUInteger)idx;
- (void) setObject:(User*) user atIndexedSubcript:(NSUInteger)idx;

@end

@implementation MyCocoaheadsList {
    NSMutableArray * myCocoaheadsList;
}

- (User *) objectAtIndexedSubscript:(NSUInteger)idx{
    return (User *) myCocoaheadsList[idx];
}

- (void) setObject:(User*) user atIndexedSubcript:(NSUInteger)idx {
    myCocoaheadsList[idx] = user;
}

@end

Appel via :

MyCocoaheadsList * mycocoaheadsList = [[MyCocoaheadsList alloc] init];
User * firstUser = mycocoaheadsList[0];
ASTUCES DÉMO


•   Find and Search indexation de symbols & Insert pattern

•   Callers or Callees

•   Tag Fixme & TODO

•   Refactor -> convert to modern Objectiv C
XCODE 4.5 ARCHITECTURES
SUPPORTÉES & IMPACTS 1/2
XCODE 4.5 ARCHITECTURES
       SUPPORTÉES & IMPACTS 1/2
• Simulateur   4.3 disparu sous Mountain Lion
XCODE 4.5 ARCHITECTURES
       SUPPORTÉES & IMPACTS 1/2
• Simulateur   4.3 disparu sous Mountain Lion

• Abandon   de armv6 (iPhone 1, iPod touch 2G (2007), iPhone
 3G)
XCODE 4.5 ARCHITECTURES
        SUPPORTÉES & IMPACTS 1/2
• Simulateur   4.3 disparu sous Mountain Lion

• Abandon   de armv6 (iPhone 1, iPod touch 2G (2007), iPhone
 3G)




• iOS   4.3 minimum supporté.

  • =>   solution simple de tester ???
Xcode 4.5
BIBLIOGRAPHIE
• Details
       sur literals & object subscription : http://clang.llvm.org/
 docs/ObjectiveCLiterals.html

• WWDC        2012 session 405 : Modern Objective C (vidéo)

• Xcode     release : https://developer.apple.com/library/mac/#releasenotes/
 DeveloperTools/RN-Xcode/_index.html

• What’s    new in Xcode : http://developer.apple.com/library/ios/#documentation/
 DeveloperTools/Conceptual/WhatsNewXcode/00-Introduction/Introduction.html


• http://en.wikipedia.org/wiki/Xcode#Major_features
QUESTIONS

Contenu connexe

PDF
CocoaHeads Rennes #5 : iOS & Android
PDF
Xcode Server - Jeffrey Macko
PDF
Hermes, génération et déploiement d'ipa by Peter Meuel
PDF
Transition de NIBs/XIBs vers Storyboards
PDF
Test flight et les outils de distribution continue par simone civetta de xebia
PDF
Code flow - Cocoaheads paris
PDF
Introduction to WebRTC on iOS
PDF
BlaBlaCar - Going Native !
CocoaHeads Rennes #5 : iOS & Android
Xcode Server - Jeffrey Macko
Hermes, génération et déploiement d'ipa by Peter Meuel
Transition de NIBs/XIBs vers Storyboards
Test flight et les outils de distribution continue par simone civetta de xebia
Code flow - Cocoaheads paris
Introduction to WebRTC on iOS
BlaBlaCar - Going Native !

Tendances (17)

PDF
Présentation de Carthage par Simone Civetta
PDF
Multi-Threading Et Cocoa
PDF
L'intégration continue avec Bitrise
PPTX
Nouveauté iOS 6
PDF
Firebase par nicolas lehovetzki
KEY
Build automatique et distribution OTA avec Xcode 4.x et Jenkins
PPT
CocoaHeads Toulouse - Xcode et les tests - Epitez
PDF
Introduction à Play Framework 2
PDF
App groups, faire communiquer ses applications {Cocoaheads Montpellier}
PDF
JENKINS_OWF11_OSDC_PARIS20110924
PPTX
CocoaPods par David Yang
PPTX
1 tours horizon
PDF
SDN OpenDaylight
PPTX
Javaoop
PPTX
Android distribution cyanogen mod _ guillaume lesniak, student at miage nancy
PPTX
Java vs .Net
PDF
Gatekeeper par Guillaume Faure
Présentation de Carthage par Simone Civetta
Multi-Threading Et Cocoa
L'intégration continue avec Bitrise
Nouveauté iOS 6
Firebase par nicolas lehovetzki
Build automatique et distribution OTA avec Xcode 4.x et Jenkins
CocoaHeads Toulouse - Xcode et les tests - Epitez
Introduction à Play Framework 2
App groups, faire communiquer ses applications {Cocoaheads Montpellier}
JENKINS_OWF11_OSDC_PARIS20110924
CocoaPods par David Yang
1 tours horizon
SDN OpenDaylight
Javaoop
Android distribution cyanogen mod _ guillaume lesniak, student at miage nancy
Java vs .Net
Gatekeeper par Guillaume Faure
Publicité

En vedette (6)

PDF
SimPholders par Nicolas Lauquin
PDF
Cocoaheads Lille - Septembre 2013
PDF
Universal app par d’Olivier Collet
PDF
Responsive design bookmarklet
PDF
Sango Nini May 2015 FIN
PDF
Icon preview tool
SimPholders par Nicolas Lauquin
Cocoaheads Lille - Septembre 2013
Universal app par d’Olivier Collet
Responsive design bookmarklet
Sango Nini May 2015 FIN
Icon preview tool
Publicité

Similaire à Xcode 4.5 (20)

PDF
L’environnement du développement mobile iOS & Android
PDF
Xcode の一歩進んだ使い方 分散ビルド
PPTX
Gui android eclipse
PPT
développement mobile sous Android Studio
PPT
Presentation of Oracle database products
PPT
Presentation of Oracle database products for Beginners
PDF
AlterWay SolutionsLinux Outils Industrialisation PHP
PPTX
Introduction to iOS Development
PDF
Alphorm.com Formation Android 5
PDF
cours-android.pdf
PDF
XWiki : évolutions 2012 / 2013
PDF
Evolutions XWiki 2012/2013
PDF
Java EE, un ami qui vous veut du bien
PDF
Créer un Micro PaaS avec Docker et Maven
PDF
Develop on Apache Ofbiz
PDF
Formation développement iOS - Tutoriel
PDF
Développement web mobile avec IONIC 2
PDF
Tech Conf n°1 - Développement natif d'applications mobiles
KEY
2011 06-pres
PPTX
Hackathon Android Abidjan
L’environnement du développement mobile iOS & Android
Xcode の一歩進んだ使い方 分散ビルド
Gui android eclipse
développement mobile sous Android Studio
Presentation of Oracle database products
Presentation of Oracle database products for Beginners
AlterWay SolutionsLinux Outils Industrialisation PHP
Introduction to iOS Development
Alphorm.com Formation Android 5
cours-android.pdf
XWiki : évolutions 2012 / 2013
Evolutions XWiki 2012/2013
Java EE, un ami qui vous veut du bien
Créer un Micro PaaS avec Docker et Maven
Develop on Apache Ofbiz
Formation développement iOS - Tutoriel
Développement web mobile avec IONIC 2
Tech Conf n°1 - Développement natif d'applications mobiles
2011 06-pres
Hackathon Android Abidjan

Plus de CocoaHeads France (20)

PDF
Mutation testing for a safer Future
PDF
iOS App Group for Debugging
PDF
Asynchronous swift
PDF
Visual accessibility in iOS11
PDF
My script - One year of CocoaHeads
PDF
Ui testing dealing with push notifications
PDF
CONTINUOUS DELIVERY WITH FASTLANE
PDF
Super combinators
PDF
Design like a developer
PDF
Handle the error
PDF
Quoi de neuf dans iOS 10.3
PDF
IoT Best practices
PDF
SwiftyGPIO
PDF
Présentation de HomeKit
PDF
Programme MFI retour d'expérience
PDF
How to communicate with Smart things?
PDF
Build a lego app with CocoaPods
PDF
Let's migrate to Swift 3.0
PDF
Project Entourage
PDF
What's new in iOS9
Mutation testing for a safer Future
iOS App Group for Debugging
Asynchronous swift
Visual accessibility in iOS11
My script - One year of CocoaHeads
Ui testing dealing with push notifications
CONTINUOUS DELIVERY WITH FASTLANE
Super combinators
Design like a developer
Handle the error
Quoi de neuf dans iOS 10.3
IoT Best practices
SwiftyGPIO
Présentation de HomeKit
Programme MFI retour d'expérience
How to communicate with Smart things?
Build a lego app with CocoaPods
Let's migrate to Swift 3.0
Project Entourage
What's new in iOS9

Dernier (9)

PDF
Frais et décompte dans SAP S/4HANA Transportation Management, S4TM3 Col26
PDF
Démystification des QR codes - histoire - utilisations - techniques
PPT
Pratiques des systèmes d'information ppt
PDF
Analyse technique approfondie pour la gestion des transports dans SAP S/4HANA...
PDF
Architecture logicielle et Modeles de Conception
PDF
IPTV Meilleur - Le Meilleur Abonnement IPTV en France pour 2025
PPTX
test pour la présentation foire de Chalôns V1
PPTX
Projet de Fin d’Études – Plateforme FMS pour la Gestion des FCPR
PDF
COURS GCDs Chap 9.pdf tous les éléments.
Frais et décompte dans SAP S/4HANA Transportation Management, S4TM3 Col26
Démystification des QR codes - histoire - utilisations - techniques
Pratiques des systèmes d'information ppt
Analyse technique approfondie pour la gestion des transports dans SAP S/4HANA...
Architecture logicielle et Modeles de Conception
IPTV Meilleur - Le Meilleur Abonnement IPTV en France pour 2025
test pour la présentation foire de Chalôns V1
Projet de Fin d’Études – Plateforme FMS pour la Gestion des FCPR
COURS GCDs Chap 9.pdf tous les éléments.

Xcode 4.5

  • 2. XCODE 4.5 Nicolas Lauquin - L’atelier du mobile 8 novembre 2012 @ CocoaHeads
  • 4. pense, crée et fait connaitre vos applications mobiles
  • 5. INTRODUCTION • Chronologie d’Xcode 4.x & fonctionnalités clefs • Améliorations d’Objective C • Démo • Les impacts & architectures supportées Note : présentation orientée iOS
  • 6. (R)EVOLUTION D’XCODE 4.0 MARS 2011 (PUBLIC RELEASE)
  • 7. (R)EVOLUTION D’XCODE 4.0 MARS 2011 (PUBLIC RELEASE) • Présentations «Hello Xcode 4» Cocoaheads du 14 avril 2011
  • 8. (R)EVOLUTION D’XCODE 4.0 MARS 2011 (PUBLIC RELEASE) • Présentations «Hello Xcode 4» Cocoaheads du 14 avril 2011 • «Un outil attendu (instable ? ;-))»
  • 9. (R)EVOLUTION D’XCODE 4.0 MARS 2011 (PUBLIC RELEASE) • Présentations «Hello Xcode 4» Cocoaheads du 14 avril 2011 • «Un outil attendu (instable ? ;-))» • «Une modification du processus de développement»
  • 10. (R)EVOLUTION D’XCODE 4.0 MARS 2011 (PUBLIC RELEASE) • Présentations «Hello Xcode 4» Cocoaheads du 14 avril 2011 • «Un outil attendu (instable ? ;-))» • «Une modification du processus de développement» • «Des fonctionnalités perdues & des évolutions»
  • 11. EVOLUTION XCODE 4.1 JUILLET 2011
  • 12. EVOLUTION XCODE 4.1 JUILLET 2011 • Support de Mac OS X LION (10.7)
  • 13. EVOLUTION XCODE 4.1 JUILLET 2011 • Support de Mac OS X LION (10.7) • Autolayout (Lion)
  • 14. EVOLUTION XCODE 4.1 JUILLET 2011 • Support de Mac OS X LION (10.7) • Autolayout (Lion) • OS X Application Sandbox (Lion)
  • 15. EVOLUTION XCODE 4.1 JUILLET 2011 • Support de Mac OS X LION (10.7) • Autolayout (Lion) • OS X Application Sandbox (Lion) • Default compiler LLVM-GCC 4.2
  • 16. EVOLUTION XCODE 4.1 JUILLET 2011 • Support de Mac OS X LION (10.7) • Autolayout (Lion) • OS X Application Sandbox (Lion) • Default compiler LLVM-GCC 4.2 • Custom Behaviors
  • 17. EVOLUTION XCODE 4.1 JUILLET 2011 • Support de Mac OS X LION (10.7) • Autolayout (Lion) • OS X Application Sandbox (Lion) • Default compiler LLVM-GCC 4.2 • Custom Behaviors • Git Remote Management
  • 18. EVOLUTION XCODE 4.2 OCTOBRE 2011
  • 19. EVOLUTION XCODE 4.2 OCTOBRE 2011 • Support iOS 5
  • 20. EVOLUTION XCODE 4.2 OCTOBRE 2011 • Support iOS 5 • ARC
  • 21. EVOLUTION XCODE 4.2 OCTOBRE 2011 • Support iOS 5 • ARC • Default compiler LLVM 3.0
  • 22. EVOLUTION XCODE 4.2 OCTOBRE 2011 • Support iOS 5 • ARC • Default compiler LLVM 3.0 • Storyboarding
  • 23. EVOLUTION XCODE 4.2 OCTOBRE 2011 • Support iOS 5 • ARC • Default compiler LLVM 3.0 • Storyboarding • Location Simulation
  • 24. EVOLUTION XCODE 4.2 OCTOBRE 2011 • Support iOS 5 • ARC • Default compiler LLVM 3.0 • Storyboarding • Location Simulation • Dernière version compatible Snow Leopard
  • 25. EVOLUTION XCODE 4.3 MARS 2012
  • 26. EVOLUTION XCODE 4.3 MARS 2012 • Une application “tout en un“ téléchargeable depuis le Mac AppStore. Bybye «/Developer»
  • 27. EVOLUTION XCODE 4.3 MARS 2012 • Une application “tout en un“ téléchargeable depuis le Mac AppStore. Bybye «/Developer» • Auto Layout est par défaut pour tout projet Cocoa
  • 28. EVOLUTION XCODE 4.3 MARS 2012 • Une application “tout en un“ téléchargeable depuis le Mac AppStore. Bybye «/Developer» • Auto Layout est par défaut pour tout projet Cocoa • Xcode 4.3.1 -> support iOS5.1
  • 29. EVOLUTION XCODE 4.3 MARS 2012 • Une application “tout en un“ téléchargeable depuis le Mac AppStore. Bybye «/Developer» • Auto Layout est par défaut pour tout projet Cocoa • Xcode 4.3.1 -> support iOS5.1 • Xcode 4.3.3 -> maj pour 10.7.4
  • 30. EVOLUTION XCODE 4.4 JUILLET 2012
  • 31. EVOLUTION XCODE 4.4 JUILLET 2012 • Support de Mountain Lion (10.8)
  • 32. EVOLUTION XCODE 4.4 JUILLET 2012 • Support de Mountain Lion (10.8) • Fonctionne sur Mac OS X Lion et Mountain Lion
  • 33. EVOLUTION XCODE 4.4 JUILLET 2012 • Support de Mountain Lion (10.8) • Fonctionne sur Mac OS X Lion et Mountain Lion • LLVM 4.0 Compiler màj (literals & subscription) - OS X
  • 34. EVOLUTION XCODE 4.4 JUILLET 2012 • Support de Mountain Lion (10.8) • Fonctionne sur Mac OS X Lion et Mountain Lion • LLVM 4.0 Compiler màj (literals & subscription) - OS X • Synthesize par défaut pour les properties
  • 35. EVOLUTION XCODE 4.4 JUILLET 2012 • Support de Mountain Lion (10.8) • Fonctionne sur Mac OS X Lion et Mountain Lion • LLVM 4.0 Compiler màj (literals & subscription) - OS X • Synthesize par défaut pour les properties • Amélioration de l’«analyzer» (common security mistakes in API and malloc usages)
  • 36. EVOLUTION XCODE 4.4 JUILLET 2012 • Support de Mountain Lion (10.8) • Fonctionne sur Mac OS X Lion et Mountain Lion • LLVM 4.0 Compiler màj (literals & subscription) - OS X • Synthesize par défaut pour les properties • Amélioration de l’«analyzer» (common security mistakes in API and malloc usages) • 4.4.1 -> avec correction de quelques bugs
  • 37. EVOLUTION XCODE 4.5 SEPTEMBRE 2012
  • 38. EVOLUTION XCODE 4.5 SEPTEMBRE 2012 • iOS6 support
  • 39. EVOLUTION XCODE 4.5 SEPTEMBRE 2012 • iOS6 support • Écran 4“ Retina de l’iPhone 5 & iPod
  • 40. EVOLUTION XCODE 4.5 SEPTEMBRE 2012 • iOS6 support • Écran 4“ Retina de l’iPhone 5 & iPod • Support des literals & subscripting pour iOS
  • 41. EVOLUTION XCODE 4.5 SEPTEMBRE 2012 • iOS6 support • Écran 4“ Retina de l’iPhone 5 & iPod • Support des literals & subscripting pour iOS • Autolayout pour iOS
  • 42. EVOLUTION XCODE 4.5 SEPTEMBRE 2012 • iOS6 support • Écran 4“ Retina de l’iPhone 5 & iPod • Support des literals & subscripting pour iOS • Autolayout pour iOS • LLDB is now the default debugger & LLDB supports hardware watchpoints on iOS devices
  • 43. EVOLUTION XCODE 4.5 SEPTEMBRE 2012 • iOS6 support • Écran 4“ Retina de l’iPhone 5 & iPod • Support des literals & subscripting pour iOS • Autolayout pour iOS • LLDB is now the default debugger & LLDB supports hardware watchpoints on iOS devices • Xcode 4.5.1 (octobre) -> bug fix & stabilité
  • 44. EVOLUTION XCODE 4.5 SEPTEMBRE 2012 • iOS6 support • Écran 4“ Retina de l’iPhone 5 & iPod • Support des literals & subscripting pour iOS • Autolayout pour iOS • LLDB is now the default debugger & LLDB supports hardware watchpoints on iOS devices • Xcode 4.5.1 (octobre) -> bug fix & stabilité • Xcode 4.5.2 (novembre) -> support de l’iPad mini & iPad écran retina
  • 45. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 1/5
  • 46. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 1/5 #import "CocoaheadsMeetingViewController.h" @implementation CocoaheadsMeetingViewController - (void)listeningThePresentation { [self carefully]; } - (void)carefully {} @end
  • 47. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 1/5 #import "CocoaheadsMeetingViewController.h" @implementation CocoaheadsMeetingViewController - (void)listeningThePresentation { [self carefully]; } - (void)carefully {} @end Avant Xcode 4.4 -> warning méthode non trouvée
  • 48. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 2/5
  • 49. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 2/5 Solution 1) Ordonnancer les méthodes #import "CocoaheadsMeetingViewController.h" @implementation CocoaheadsMeetingViewController - (void)carefully {} - (void)listeningThePresentation { [self carefully]; } @end
  • 50. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 2/5 Solution 1) Ordonnancer les méthodes #import "CocoaheadsMeetingViewController.h" @implementation CocoaheadsMeetingViewController - (void)carefully {} - (void)listeningThePresentation { [self carefully]; } @end Analyse : • ne fonctionne pas tout le temps • surtout une perte de temps
  • 51. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 3/5
  • 52. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 3/5 Solution 2) Classe publique
  • 53. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 3/5 Solution 2) Classe publique @interface CocoaheadsMeetingViewController : UIViewController - (void)carefully; @end @implementation CocoaheadsMeetingViewController - (void)listeningThePresentation { [self carefully]; } - (void)carefully {} @end
  • 54. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 3/5 Solution 2) Classe publique @interface CocoaheadsMeetingViewController : UIViewController - (void)carefully; @end @implementation CocoaheadsMeetingViewController - (void)listeningThePresentation { [self carefully]; } - (void)carefully {} @end Analyse : • mauvaise exposition/programmation
  • 55. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 4/5
  • 56. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 4/5 Solution 3) Extension de classe
  • 57. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 4/5 Solution 3) Extension de classe @interface CocoaheadsMeetingViewController () - (void)carefully; @end @implementation CocoaheadsMeetingViewController - (void)listeningThePresentation { [self carefully]; } - (void)carefully {}
  • 58. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 4/5 Solution 3) Extension de classe @interface CocoaheadsMeetingViewController () - (void)carefully; @end @implementation CocoaheadsMeetingViewController - (void)listeningThePresentation { [self carefully]; } - (void)carefully {} Analyse : • permet l’ajout de “property“ privées & méthodes accessibles depuis un nib • reste une perte de temps & un workaround
  • 59. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 5/5
  • 60. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 5/5 Solution 4)
  • 61. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : ORDRE DES MÉTHODES 5/5 Solution 4) Ça fonctionne tout simplement dans Xcode 4.5
  • 62. AMÉLIORATION D’OBJECTIVE C AMÉLIORATION : ENUM Enum with fixed underlying type typedef enum CocoaheadsPublicType : NSUInteger { CocoaheadsPublicDevelopper, CocoaheadsPublicDesigner, CocoaheadsPublicPM } CocoaheadsPublicType; Analyse : • enumération typées • Warning type checking • Warning handeling all enums values
  • 63. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : PROPERTIES
  • 64. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : PROPERTIES @interface PropertyObject : NSObject @property (readwrite, strong) NSString * name; @end @implementation PropertyObject @end Analyse : •“synthesize“ par défaut •chaque accesseur est généré si non fourni
  • 65. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : PROPERTIES @interface PropertyObject : NSObject @property (readwrite, strong) NSString * name; @end @implementation PropertyObject @synthesize name = _name;// generated by default @end Analyse : •“synthesize“ par défaut •chaque accesseur est généré si non fourni •variable d’instance généré par défaut “_variable“ si non fournie
  • 66. AMÉLIORATION D’OBJECTIVE C SIMPLIFICATION : PROPERTIES @interface PropertyObject : NSObject @property (readwrite, strong) NSString * name; @end @implementation PropertyObject @synthesize name = _name;// generated by default @end Analyse : •“synthesize“ par défaut •chaque accesseur est généré si non fourni •variable d’instance généré par défaut “_variable“ si non fournie •compatibilité :
  • 67. LITERALS 1/6 INTRO
  • 68. LITERALS 1/6 INTRO • Code allégé
  • 69. LITERALS 1/6 INTRO • Code allégé • Gain de temps
  • 70. LITERALS 1/6 INTRO • Code allégé • Gain de temps • “boxing“ : primitive value to object. (Necessary for Foundation collections)
  • 71. LITERALS 2/6 NSNUMBER - BOXED NUMBER
  • 72. LITERALS 2/6 NSNUMBER - BOXED NUMBER • [NSNumber numberWithInt:42];
  • 73. LITERALS 2/6 NSNUMBER - BOXED NUMBER • [NSNumber numberWithInt:42]; -> @42
  • 74. LITERALS 2/6 NSNUMBER - BOXED NUMBER • [NSNumber numberWithInt:42]; -> @42 • [NSNumber numberWithBool:YES];
  • 75. LITERALS 2/6 NSNUMBER - BOXED NUMBER • [NSNumber numberWithInt:42]; -> @42 • [NSNumber numberWithBool:YES]; -> @YES
  • 76. LITERALS 2/6 NSNUMBER - BOXED NUMBER • [NSNumber numberWithInt:42]; -> @42 • [NSNumber numberWithBool:YES]; -> @YES • [NSNumber numberWithFloat:3.141592654F];
  • 77. LITERALS 2/6 NSNUMBER - BOXED NUMBER • [NSNumber numberWithInt:42]; -> @42 • [NSNumber numberWithBool:YES]; -> @YES • [NSNumber numberWithFloat:3.141592654F]; -> @3.141592654F;
  • 79. LITERALS 3/6 BOXED EXPRESSIONS Syntaxe : @( expression )
  • 80. LITERALS 3/6 BOXED EXPRESSIONS Syntaxe : @( expression ) • 1) Numbers
  • 81. LITERALS 3/6 BOXED EXPRESSIONS Syntaxe : @( expression ) • 1) Numbers • NSNumber *piOverTwo = @(M_PI / 2); // [NSNumber numberWithDouble:(M_PI / 2)]
  • 82. LITERALS 3/6 BOXED EXPRESSIONS Syntaxe : @( expression ) • 1) Numbers • NSNumber *piOverTwo = @(M_PI / 2); // [NSNumber numberWithDouble:(M_PI / 2)] • 2) Enumerated types : • typedef enum { Red, Green, Blue } Color; • NSNumber *favoriteColor = @(Green); // [NSNumber numberWithInt:((int)Green)]
  • 83. LITERALS 3/6 BOXED EXPRESSIONS Syntaxe : @( expression ) • 1) Numbers • NSNumber *piOverTwo = @(M_PI / 2); // [NSNumber numberWithDouble:(M_PI / 2)] • 2) Enumerated types : • typedef enum { Red, Green, Blue } Color; • NSNumber *favoriteColor = @(Green); // [NSNumber numberWithInt:((int)Green)] • 3) Strings : • NSString *path = @(getenv("PATH")); // [NSString stringWithUTF8String:(getenv("PATH"))] • NSArray *pathComponents = [path componentsSeparatedByString:@":"];
  • 84. LITERALS 4/6 DICTIONARY
  • 85. LITERALS 4/6 DICTIONARY • NSDictionnary *dict = [NSDictionnary dictionnaryWithObjectsAndKeys:{"val1", "key1", "val2", "key2"};
  • 86. LITERALS 4/6 DICTIONARY • NSDictionnary *dict = [NSDictionnary dictionnaryWithObjectsAndKeys:{"val1", "key1", "val2", "key2"}; • NSDictionnary *dict = @{ @"key1":@"val1", @"key2":@"val2" };
  • 87. LITERALS 4/6 DICTIONARY • NSDictionnary *dict = [NSDictionnary dictionnaryWithObjectsAndKeys:{"val1", "key1", "val2", "key2"}; • NSDictionnary *dict = @{ @"key1":@"val1", @"key2":@"val2" }; • Syntaxe @{key : obj, … }
  • 88. LITERALS 4/6 DICTIONARY • NSDictionnary *dict = [NSDictionnary dictionnaryWithObjectsAndKeys:{"val1", "key1", "val2", "key2"}; • NSDictionnary *dict = @{ @"key1":@"val1", @"key2":@"val2" }; • Syntaxe @{key : obj, … } • -> Attention cohérence
  • 89. LITERALS 5/6 ARRAY
  • 90. LITERALS 5/6 ARRAY • NSArray *ar = [NSArray arrayWithObjects:@"titi", @"toto", nil];
  • 91. LITERALS 5/6 ARRAY • NSArray *ar = [NSArray arrayWithObjects:@"titi", @"toto", nil]; • NSArray *ar = @[@"titi", @"toto"];
  • 92. LITERALS 5/6 ARRAY • NSArray *ar = [NSArray arrayWithObjects:@"titi", @"toto", nil]; • NSArray *ar = @[@"titi", @"toto"]; • Syntaxe : @[obj1, obj2]
  • 93. LITERALS 5/6 CONTAINER
  • 94. LITERALS 5/6 CONTAINER • Container sont “immutable“
  • 95. LITERALS 5/6 CONTAINER • Container sont “immutable“ • Utiliser : “-mutableCopy“ NSMutableArray * numberArray = [@[ @"one", @"two", @"three"]mutableCopy];
  • 96. LITERALS 5/6 CONTAINER • Container sont “immutable“ • Utiliser : “-mutableCopy“ NSMutableArray * numberArray = [@[ @"one", @"two", @"three"]mutableCopy]; • Usage static : «Initializer element is not a compile-time constant»
  • 97. LITERALS 5/6 CONTAINER • Container sont “immutable“ • Utiliser : “-mutableCopy“ NSMutableArray * numberArray = [@[ @"one", @"two", @"three"]mutableCopy]; • Usage static : «Initializer element is not a compile-time constant» • workaround : affecter la valeur dans la méthode “+initialize“ de votre classe
  • 98. OBJECT SUBSCRIPTING 1/3 Array (index subscripting) NSMutableArray *array = ...; NSUInteger idx = ...; id newObject = ...; id oldObject = array[idx]; array[idx] = newObject;! ! // replace oldObject with newObject
  • 99. OBJECT SUBSCRIPTING 1/3 Array (index subscripting) NSMutableArray *array = ...; NSUInteger idx = ...; id newObject = ...; id oldObject = array[idx]; array[idx] = newObject;! ! // replace oldObject with newObject Dictionnary (key subscripting) NSMutableDictionary *dictionary = ...; NSString *key = ...; oldObject = dictionary[key]; dictionary[key] = newObject;!// replace oldObject with newObject
  • 100. OBJECT SUBSCRIPTING 2/3 DÉCRYPTAGE
  • 101. OBJECT SUBSCRIPTING 2/3 DÉCRYPTAGE Array id value = array[idx]; -> id value = [array objectAtIndexedSubscript:idx]; array[idx] = object; -> [array setObject:object atIndexedSubscript:idx]; idx : integral type object : object pointer
  • 102. OBJECT SUBSCRIPTING 2/3 DÉCRYPTAGE Array id value = array[idx]; -> id value = [array objectAtIndexedSubscript:idx]; array[idx] = object; -> [array setObject:object atIndexedSubscript:idx]; idx : integral type object : object pointer Dictionnary id value = dict[key]; -> id value = [dict objectForKeyedSubscript:key]; dict[key] = object; -> [dict setObject:object forKeyedSubscript:key]; key & object : object pointer
  • 103. OBJECT SUBSCRIPTING 3/3 VOTRE CLASSE “SUBSCRIPTABLE“
  • 104. OBJECT SUBSCRIPTING 3/3 VOTRE CLASSE “SUBSCRIPTABLE“ @interface MyCocoaheadsList : NSObject - (User *) objectAtIndexedSubscript:(NSUInteger)idx; - (void) setObject:(User*) user atIndexedSubcript:(NSUInteger)idx; @end @implementation MyCocoaheadsList { NSMutableArray * myCocoaheadsList; } - (User *) objectAtIndexedSubscript:(NSUInteger)idx{ return (User *) myCocoaheadsList[idx]; } - (void) setObject:(User*) user atIndexedSubcript:(NSUInteger)idx { myCocoaheadsList[idx] = user; } @end Appel via : MyCocoaheadsList * mycocoaheadsList = [[MyCocoaheadsList alloc] init]; User * firstUser = mycocoaheadsList[0];
  • 105. ASTUCES DÉMO • Find and Search indexation de symbols & Insert pattern • Callers or Callees • Tag Fixme & TODO • Refactor -> convert to modern Objectiv C
  • 107. XCODE 4.5 ARCHITECTURES SUPPORTÉES & IMPACTS 1/2 • Simulateur 4.3 disparu sous Mountain Lion
  • 108. XCODE 4.5 ARCHITECTURES SUPPORTÉES & IMPACTS 1/2 • Simulateur 4.3 disparu sous Mountain Lion • Abandon de armv6 (iPhone 1, iPod touch 2G (2007), iPhone 3G)
  • 109. XCODE 4.5 ARCHITECTURES SUPPORTÉES & IMPACTS 1/2 • Simulateur 4.3 disparu sous Mountain Lion • Abandon de armv6 (iPhone 1, iPod touch 2G (2007), iPhone 3G) • iOS 4.3 minimum supporté. • => solution simple de tester ???
  • 111. BIBLIOGRAPHIE • Details sur literals & object subscription : http://clang.llvm.org/ docs/ObjectiveCLiterals.html • WWDC 2012 session 405 : Modern Objective C (vidéo) • Xcode release : https://developer.apple.com/library/mac/#releasenotes/ DeveloperTools/RN-Xcode/_index.html • What’s new in Xcode : http://developer.apple.com/library/ios/#documentation/ DeveloperTools/Conceptual/WhatsNewXcode/00-Introduction/Introduction.html • http://en.wikipedia.org/wiki/Xcode#Major_features

Notes de l'éditeur

  • #2: \n
  • #3: \n
  • #4: \n
  • #5: \n
  • #6: \n
  • #7: \n
  • #8: \n
  • #9: \n
  • #10: \n
  • #11: \n
  • #12: \n
  • #13: \n
  • #14: \n
  • #15: \n
  • #16: \n
  • #17: \n
  • #18: \n
  • #19: \n
  • #20: \n
  • #21: \n
  • #22: \n
  • #23: \n
  • #24: \n
  • #25: \n
  • #26: Amélioration du rechercher/remplacer (Pattern & Appelant et appelé & indexation de symbole)\n Tag Fixme & TODO & #pragma mark listés dans les méthodes\n
  • #27: Amélioration du rechercher/remplacer (Pattern & Appelant et appelé & indexation de symbole)\n Tag Fixme & TODO & #pragma mark listés dans les méthodes\n
  • #28: Amélioration du rechercher/remplacer (Pattern & Appelant et appelé & indexation de symbole)\n Tag Fixme & TODO & #pragma mark listés dans les méthodes\n
  • #29: Amélioration du rechercher/remplacer (Pattern & Appelant et appelé & indexation de symbole)\n Tag Fixme & TODO & #pragma mark listés dans les méthodes\n
  • #30: Amélioration du rechercher/remplacer (Pattern & Appelant et appelé & indexation de symbole)\n Tag Fixme & TODO & #pragma mark listés dans les méthodes\n
  • #31: Amélioration du rechercher/remplacer (Pattern & Appelant et appelé & indexation de symbole)\n Tag Fixme & TODO & #pragma mark listés dans les méthodes\n
  • #32: \n
  • #33: \n
  • #34: \n
  • #35: \n
  • #36: \n
  • #37: \n
  • #38: \n
  • #39: \n
  • #40: \n
  • #41: \n
  • #42: \n
  • #43: \n
  • #44: \n
  • #45: \n
  • #46: \n
  • #47: \n
  • #48: \n
  • #49: \n
  • #50: \n
  • #51: \n
  • #52: \n
  • #53: \n
  • #54: \n
  • #55: \n
  • #56: \n
  • #57: \n
  • #58: \n
  • #59: \n
  • #60: \n
  • #61: \n
  • #62: \n
  • #63: \n
  • #64: NSNumber *fortyTwo = @42; -> [NSNumber numberWithInt:42]\n NSNumber *fortyTwoUnsigned = @42U; -> [NSNumber numberWithUnsignedInt:42U]\n NSNumber *fortyTwoLong = @42L; -> [NSNumber numberWithLong:42L]\n NSNumber *fortyTwoLongLong = @42LL; -> [NSNumber numberWithLongLong:42LL]\n NSNumber *piFloat = @3.141592654F; -> [NSNumber numberWithFloat:3.141592654F]\n NSNumber *piDouble = @3.1415926535; -> [NSNumber numberWithDouble:3.1415926535]\n
  • #65: NSNumber *fortyTwo = @42; -> [NSNumber numberWithInt:42]\n NSNumber *fortyTwoUnsigned = @42U; -> [NSNumber numberWithUnsignedInt:42U]\n NSNumber *fortyTwoLong = @42L; -> [NSNumber numberWithLong:42L]\n NSNumber *fortyTwoLongLong = @42LL; -> [NSNumber numberWithLongLong:42LL]\n NSNumber *piFloat = @3.141592654F; -> [NSNumber numberWithFloat:3.141592654F]\n NSNumber *piDouble = @3.1415926535; -> [NSNumber numberWithDouble:3.1415926535]\n
  • #66: NSNumber *fortyTwo = @42; -> [NSNumber numberWithInt:42]\n NSNumber *fortyTwoUnsigned = @42U; -> [NSNumber numberWithUnsignedInt:42U]\n NSNumber *fortyTwoLong = @42L; -> [NSNumber numberWithLong:42L]\n NSNumber *fortyTwoLongLong = @42LL; -> [NSNumber numberWithLongLong:42LL]\n NSNumber *piFloat = @3.141592654F; -> [NSNumber numberWithFloat:3.141592654F]\n NSNumber *piDouble = @3.1415926535; -> [NSNumber numberWithDouble:3.1415926535]\n
  • #67: NSNumber *fortyTwo = @42; -> [NSNumber numberWithInt:42]\n NSNumber *fortyTwoUnsigned = @42U; -> [NSNumber numberWithUnsignedInt:42U]\n NSNumber *fortyTwoLong = @42L; -> [NSNumber numberWithLong:42L]\n NSNumber *fortyTwoLongLong = @42LL; -> [NSNumber numberWithLongLong:42LL]\n NSNumber *piFloat = @3.141592654F; -> [NSNumber numberWithFloat:3.141592654F]\n NSNumber *piDouble = @3.1415926535; -> [NSNumber numberWithDouble:3.1415926535]\n
  • #68: NSNumber *fortyTwo = @42; -> [NSNumber numberWithInt:42]\n NSNumber *fortyTwoUnsigned = @42U; -> [NSNumber numberWithUnsignedInt:42U]\n NSNumber *fortyTwoLong = @42L; -> [NSNumber numberWithLong:42L]\n NSNumber *fortyTwoLongLong = @42LL; -> [NSNumber numberWithLongLong:42LL]\n NSNumber *piFloat = @3.141592654F; -> [NSNumber numberWithFloat:3.141592654F]\n NSNumber *piDouble = @3.1415926535; -> [NSNumber numberWithDouble:3.1415926535]\n
  • #69: NSNumber *fortyTwo = @42; -> [NSNumber numberWithInt:42]\n NSNumber *fortyTwoUnsigned = @42U; -> [NSNumber numberWithUnsignedInt:42U]\n NSNumber *fortyTwoLong = @42L; -> [NSNumber numberWithLong:42L]\n NSNumber *fortyTwoLongLong = @42LL; -> [NSNumber numberWithLongLong:42LL]\n NSNumber *piFloat = @3.141592654F; -> [NSNumber numberWithFloat:3.141592654F]\n NSNumber *piDouble = @3.1415926535; -> [NSNumber numberWithDouble:3.1415926535]\n
  • #70: When the type of the parenthesized expression is (char *) or (const char *), the result of the boxed expression is a pointer to an NSString object containing equivalent character data, which is assumed to be '\\0'-terminated and UTF-8 encoded.\n(use the fixed underlying type)\n
  • #71: When the type of the parenthesized expression is (char *) or (const char *), the result of the boxed expression is a pointer to an NSString object containing equivalent character data, which is assumed to be '\\0'-terminated and UTF-8 encoded.\n(use the fixed underlying type)\n
  • #72: When the type of the parenthesized expression is (char *) or (const char *), the result of the boxed expression is a pointer to an NSString object containing equivalent character data, which is assumed to be '\\0'-terminated and UTF-8 encoded.\n(use the fixed underlying type)\n
  • #73: When the type of the parenthesized expression is (char *) or (const char *), the result of the boxed expression is a pointer to an NSString object containing equivalent character data, which is assumed to be '\\0'-terminated and UTF-8 encoded.\n(use the fixed underlying type)\n
  • #74: When the type of the parenthesized expression is (char *) or (const char *), the result of the boxed expression is a pointer to an NSString object containing equivalent character data, which is assumed to be '\\0'-terminated and UTF-8 encoded.\n(use the fixed underlying type)\n
  • #75: \n
  • #76: \n
  • #77: \n
  • #78: \n
  • #79: \n
  • #80: \n
  • #81: \n
  • #82: \n
  • #83: \n
  • #84: \n
  • #85: \n
  • #86: \n
  • #87: \n
  • #88: \n
  • #89: \n
  • #90: \n
  • #91: \n
  • #92: \n
  • #93: \n
  • #94: \n
  • #95: \n
  • #96: \n
  • #97: \n
  • #98: \n
  • #99: \n
  • #100: \n
  • #101: \n
  • #102: \n