Posté(e) le 10 mars 200817 a Salut à tous, est ce que quelques uns ici se sont attaqués au dev sur iPhone? Pour savoir comme ça . Merci d'avance de vos réponses. Nemesis Ps: pour les modos j'ai hésité entre ici et le forum Apple. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Pour ceux que le SDK intéresse, il FAUT possédé un mac, et télécharger le SDK gratuit après inscription ici : SDK Free (en). De la documentation officielle est disponible iPhone Dev Center (en). --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Je vais faire un screen du HelloWorld fournit par Apple . et le code (si ça vous interessese): /* HelloWorldClassicAppDelegate.m *\ #import "HelloWorldClassicAppDelegate.h" #define TEXT_FIELD_FONT_SIZE 15.0 #define BUTTON_FONT_SIZE 16.0 #define TEXT_LABEL_FONT_SIZE 30.0 #define TEXT_FIELD_HEIGHT_MULTIPLIER 2.0 // Provide some vertical space around text fields @implementation HelloWorldClassicAppDelegate @synthesize window; @synthesize contentView; @synthesize textField; @synthesize label; - (void)addControlsToContentView:(UIImageView *)aContentView { CGRect contentFrame = aContentView.frame; // Create a button using an image as the background. // Use the desired background image's size as the button's size UIImage *buttonBackground = [uIImage imageNamed:@"Button.png"]; CGRect buttonFrame = CGRectMake(0.0, 0.0, buttonBackground.size.width, buttonBackground.size.height); UIButton *button = [[uIButton alloc] initWithFrame:buttonFrame]; [button setTitle:@"Salut" forStates:UIControlStateNormal]; button.font = [uIFont boldSystemFontOfSize:BUTTON_FONT_SIZE]; // Center the text on the button, considering the button's shadow button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter; button.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; button.titleEdgeInsets = UIEdgeInsetsMake(-2.0, 0.0, 2.0, 0.0); //Create inset for the shadow below // Set the background image on the button [button setBackgroundImage:buttonBackground forStates:UIControlStateNormal]; [button addTarget:self action:@selector(hello:) forControlEvents:UIControlEventTouchUpInside]; //hello: is sent when the button is touched // Position the button centered horizontally in the contentView button.center = CGPointMake(aContentView.center.x, aContentView.center.y-52); [aContentView addSubview:button]; [button release]; // Create a text field to type into CGFloat textFieldWidth = contentFrame.size.width * 0.72; // and set the origin based on centering the view CGFloat textFieldOriginX = (contentFrame.size.width - textFieldWidth) / 2.0; CGFloat leftMargin = 20.0; CGRect textFieldFrame = CGRectMake(textFieldOriginX, leftMargin, textFieldWidth, TEXT_FIELD_FONT_SIZE * TEXT_FIELD_HEIGHT_MULTIPLIER); UITextField *aTextField = [[uITextField alloc] initWithFrame:textFieldFrame]; aTextField.borderStyle = UITextFieldBorderStyleRounded; aTextField.font = [uIFont systemFontOfSize:TEXT_FIELD_FONT_SIZE]; aTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; aTextField.placeholder = @"Entrez votre nom ici..."; aTextField.keyboardType = UIKeyboardTypeAlphabet; self.textField = aTextField; [aTextField release]; [aContentView addSubview: self.textField]; // Create a label for greeting output. Dimensions are based on the input field sizing leftMargin = 90.0; CGRect labelFrame = CGRectMake(textFieldOriginX, leftMargin, textFieldWidth, TEXT_LABEL_FONT_SIZE * TEXT_FIELD_HEIGHT_MULTIPLIER); UILabel *aLabel = [[uILabel alloc] initWithFrame:labelFrame]; aLabel.font = [uIFont systemFontOfSize:TEXT_LABEL_FONT_SIZE]; // Create a slightly muted green color aLabel.textColor = [uIColor colorWithRed:0.22 green:0.54 blue:0.41 alpha:1.0]; aLabel.textAlignment = UITextAlignmentCenter; self.label = aLabel; [aLabel release]; [aContentView addSubview: self.label]; } //This method is invoked when the Hello button is touched - (void)hello:(id)sender { [self.textField resignFirstResponder]; NSString *nameString = self.textField.text; if ([nameString length] == 0) { //Nothing was typed nameString = @"World"; } NSString *greeting = [NSString stringWithFormat:@"Salut %@!", nameString]; self.label.text = greeting; } - (void)dealloc { [contentView release]; [window release]; [textField release]; [label release]; [super dealloc]; } #pragma mark - #pragma mark UIApplication delegate method - (void)applicationDidFinishLaunching:(UIApplication *)application { // Set up the window and content view CGRect screenRect = [[uIScreen mainScreen] bounds]; self.window = [[[uIWindow alloc] initWithFrame:screenRect] autorelease]; // Add the image as the background view UIImageView *anImageView = [[uIImageView alloc] initWithFrame:[[uIScreen mainScreen] applicationFrame]]; anImageView.image = [uIImage imageNamed:@"Background.png"]; self.contentView = anImageView; [anImageView release]; [self.window addSubview: self.contentView]; [self addControlsToContentView: self.contentView]; // Show the window [self.window makeKeyAndVisible]; } @end /* HelloWorldClassicAppDelegate.h *\ #import <UIKit/UIKit.h> @interface HelloWorldClassicAppDelegate : NSObject { UIWindow *window; UIImageView *contentView; UITextField *textField; UILabel *label; } @property (nonatomic, retain) UIWindow *window; @property (nonatomic, retain) UIImageView *contentView; @property (nonatomic, retain) UITextField *textField; @property (nonatomic, retain) UILabel *label; @end /* HelloWorldClassic_Prefix.pch *\ // // Prefix header for all source files of the 'HelloWorldClassic' target in the 'HelloWorldClassic' project // #ifdef __OBJC__ #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #endif /* main.m *\ #import <UIKit/UIKit.h> int main(int argc, char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int retVal = UIApplicationMain(argc, argv, nil, @"HelloWorldClassicAppDelegate"); [pool release]; return retVal; } Et enfin une image de mon projet Et voilà, demandez moi si vous avez besoin d'autres choses Modifié le 10 mars 200817 a par nemesis93_75
Posté(e) le 10 mars 200817 a Pour ceux voulant y jeter un oeil : Introducing the iPhone Developer Program (en). Le sdk est dispo gratuitement mais soumis à inscription.
Posté(e) le 10 mars 200817 a Auteur Merci Quarky de ta réponse je modifie le premier post edit: rajout de l'application HelloWorld (francisé par moi ) ainsi que le code (si vous avez besoin d'autres choses, demandez moi )
Posté(e) le 11 mars 200817 a Pour ceux voulant y jeter un oeil : Introducing the iPhone Developer Program (en).Le sdk est dispo gratuitement mais soumis à inscription. Il est gratuit mais il faudra payer 100¤ pour pouvoir proposer ses applis sur le AppStore il me semble.
Posté(e) le 11 mars 200817 a Ca m'aurait bien dit de faire des ptites applis et tout pour mon iTouch. Mais à cause du fait de devoir posséder un mac pour faire ça, c'est mort. Merci Apple
Posté(e) le 11 mars 200817 a Auteur c'est sur que c'est dommage mais la prog des applis iTunes ressemble fortement à celle sur mac Ce que je trouve dommage (actuellement) c'est qu'il n'ont pas fourni de Interface Builder compatible, il sera seulement livré en Juin Alors pour faire un joli design et bien c'est tout à la mano ^^
Posté(e) le 11 mars 200817 a Peu importe que ça ressemble à de la prog sur Mac. C'est naze qu'ils limitent ça aux possesseurs de machines à Pommes :/ Je fais bien de la prog sur PS3 à partir d'un "PC"...
Posté(e) le 11 mars 200817 a Ca m'aurait bien dit de faire des ptites applis et tout pour mon iTouch.Mais à cause du fait de devoir posséder un mac pour faire ça, c'est mort. Merci Apple Comme microsoft et silverlight, le runtime est multiplateforme mais l'outil de Dev est windows only.
Posté(e) le 11 mars 200817 a Auteur Il faut toutes ces lignes pour faire un pauvre "hello world" ??? avec l'interface sinon non ^^
Posté(e) le 11 mars 200817 a Ca m'aurait bien dit de faire des ptites applis et tout pour mon iTouch.Mais à cause du fait de devoir posséder un mac pour faire ça, c'est mort. Merci Apple Comme microsoft et silverlight, le runtime est multiplateforme mais l'outil de Dev est windows only. A la différence que c'est plus facile d'avoir un windows (ou linux au besoin) dans un coin qu'un Mac OS...
Posté(e) le 11 mars 200817 a ce qui est gênant, c'est le prix du ticket d'entrée : que ce soit un système où un autre, ça veut dire qu'il faut débourser une certaine somme pour accéder aux outils de devs...
Posté(e) le 13 mars 200817 a Je vais pas tarder à m'y mettre, j'ai tout ce qu'il faut, le MAC l'iPhone, manque plus que le SDK. Par contre un truc qui m'intéresse, les fonctions IO du SDK permettent t'elles d'avoir accès au file system de l'iPhone? EDIT: apparemment oui Modifié le 13 mars 200817 a par fabrice.roge
Posté(e) le 14 mars 200817 a Une question que je me pose c'est si iTunes saura gérer le cas particulier des DonateWare. J'envisage de faire un soft pour l'iphone, mais je n'ai pas envie d'obliger les gens à payer. Après il y a toujours un moyen de rediriger sur paypal à partir d'un soft mais bon c'est certainement pas l'idéal.
Archivé
Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.