成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

詳解iPhone開發入門教程 新手必看

移動開發 iOS
本文介紹的是詳解iPhone開發入門教程 新手必看,作為新手,你不得不看,很詳細的從思路開始幫你學習iphone開發基礎,來看內容。

詳解iPhone開發入門教程 新手必看是本文要介紹的內容,本文是在壇子上看到的一篇關于iphone開發基礎教程的,主要講解iphone開發的思想和一些簡單的實現。來看詳細內容。先來推薦一篇 iPhone開發入門教程 圖解,可以作為參考!

思路:

(1)Interface Builder制作界面

(2)頭文件中增加Outlet和事件響應函數

(3)建立界面與代碼的關聯

(4)添加實際代碼(初始化、按鍵響應等)

效果: (第二張圖單擊可放大)

詳解iPhone開發入門教程 新手必看 

詳解iPhone開發入門教程 新手必看

代碼:

Java代碼 

  1.  
  2. //     
  3. //  QuizAppDelegate.h     
  4. //  Quiz     
  5. //     
  6. //  Created by bruce.lin on 6/21/11.     
  7. //  Copyright 2011 __MyCompanyName__. All rights reserved.     
  8. //     
  9.     
  10. #import <UIKit/UIKit.h>     
  11.     
  12. @interface QuizAppDelegate : NSObject <UIApplicationDelegate> {     
  13.     
  14.     int currentQuestionIndex;     
  15.          
  16.     NSMutableArray *questions;     
  17.     NSMutableArray *answers;     
  18.          
  19.     IBOutlet UILabel *questionField;     
  20.     IBOutlet UILabel *answerField;     
  21.          
  22.     UIWindow *window;     
  23. }     
  24.     
  25. @property (nonatomic, retain) IBOutlet UIWindow *window;     
  26.     
  27. -(IBAction) showQuestion:(id)sender;     
  28. -(IBAction) showAnswer:(id)sender;     
  29.     
  30. @end    
  31.     
  32. //     
  33. //  QuizAppDelegate.m     
  34. //  Quiz     
  35. //     
  36. //  Created by bruce.lin on 6/21/11.     
  37. //  Copyright 2011 __MyCompanyName__. All rights reserved.     
  38. //     
  39.     
  40. #import "QuizAppDelegate.h"    
  41.     
  42. @implementation QuizAppDelegate     
  43.     
  44.     
  45. @synthesize window=_window;     
  46.     
  47.     
  48. -(id)init     
  49. {     
  50.     [super init];     
  51.     questions=[[NSMutableArray alloc] init];     
  52.     answers=[[NSMutableArray alloc] init];     
  53.     
  54.     [questions addObject:@"iPhone多少米?"];     
  55.     [answers addObject:@"為啥告訴你"];     
  56.          
  57.     [questions addObject:@"路邊野花不要采"];     
  58.     [answers addObject:@"一只紅杏出墻來"];     
  59.          
  60.     currentQuestionIndex=0;     
  61.          
  62.     return self;     
  63. }     
  64.     
  65.     
  66. -(IBAction) showQuestion:(id)sender     
  67. {     
  68.     currentQuestionIndex++;     
  69.          
  70.     if(currentQuestionIndex >= [questions count])     
  71.     {     
  72.         currentQuestionIndex=0;     
  73.     }     
  74.          
  75.     [questionField setText:[questions objectAtIndex:currentQuestionIndex]];     
  76.          
  77.     NSLog(@"Current question is: %@",[questions objectAtIndex:currentQuestionIndex]);     
  78.          
  79.     [answerField setText:@"?"];     
  80. }     
  81.     
  82. -(IBAction) showAnswer:(id)sender     
  83. {     
  84.     [answerField setText:[answers objectAtIndex:currentQuestionIndex]];     
  85. }     
  86.     
  87.     
  88. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions     
  89. {     
  90.     // Override point for customization after application launch.     
  91.     [self.window makeKeyAndVisible];     
  92.     return YES;     
  93. }     
  94.     
  95. - (void)applicationWillResignActive:(UIApplication *)application     
  96. {     
  97.     /*    
  98.      Sent when the application is about to move from active to inactive state. 
  99. This can occur for certain types of temporary interruptions 
  100. (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.    
  101.      Use this method to pause ongoing tasks, disable timers, 
  102. and throttle down OpenGL ES frame rates. Games should use this method to pause the game.    
  103.      */    
  104. }     
  105.     
  106. - (void)applicationDidEnterBackground:(UIApplication *)application     
  107. {     
  108.     /*    
  109.      Use this method to release shared resources, save user data, invalidate timers,
  110.  and store enough application state information to restore your application to its current state in case it is terminated later.     
  111.      If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.    
  112.      */    
  113. }     
  114.     
  115. - (void)applicationWillEnterForeground:(UIApplication *)application     
  116. {     
  117.     /*    
  118.      Called as part of the transition from the background to the inactive state;
  119.  here you can undo many of the changes made on entering the background.    
  120.      */    
  121. }     
  122.     
  123. - (void)applicationDidBecomeActive:(UIApplication *)application     
  124. {     
  125.     /*    
  126.      Restart any tasks that were paused (or not yet started) while the application was inactive. 
  127. If the application was previously in the background, optionally refresh the user interface.    
  128.      */    
  129. }     
  130.     
  131. - (void)applicationWillTerminate:(UIApplication *)application     
  132. {     
  133.     /*    
  134.      Called when the application is about to terminate.    
  135.      Save data if appropriate.    
  136.      See also applicationDidEnterBackground:.    
  137.      */    
  138. }     
  139.     
  140. - (void)dealloc     
  141. {     
  142.     [_window release];     
  143.     [super dealloc];     
  144. }     
  145. @end  

小結:詳解iPhone開發入門教程 新手必看的內容介紹完了,通過本文介紹的iphone開發基礎,是不是學習到了一些內容,那么希望本文對你有所幫助!

責任編輯:zhaolei 來源: ITEYE論壇
相關推薦

2011-07-21 10:29:18

iPhone 開發

2011-09-07 11:13:27

無線路由器無線路由器設置

2011-07-18 14:15:55

iPhone iPad GIS

2010-07-27 15:53:15

2011-06-16 09:53:25

Qt QML 教程

2011-06-16 09:40:53

QML 教程

2011-06-16 09:28:14

Qt QML 教程

2010-08-02 09:36:22

Flex

2011-06-27 14:56:46

Qt Designer

2011-05-31 16:47:47

SEO

2010-06-13 09:45:35

Widget開發

2009-06-02 14:46:26

Hibernate關系映射教程

2011-07-04 17:26:00

Qt SQLite

2013-09-18 14:46:32

StormStorm集群

2011-08-22 12:01:38

iPhone開發文件

2023-11-29 07:30:08

Python用戶界面

2011-06-23 10:12:57

SEO網站建設

2009-07-08 15:12:48

Java Servle

2014-05-26 15:35:55

Web組件Web Compone

2011-07-11 09:58:52

點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 久视频在线观看 | 久久久精品一区二区 | 国产成人午夜精品影院游乐网 | 国产欧美一区二区三区在线看 | 亚洲一区二区三区视频在线 | 国产高清在线观看 | 久久91av | 日韩精品一区二区三区中文在线 | 婷婷综合| 午夜激情网 | 人人干人人干人人 | 精品久久久久久久人人人人传媒 | 精品国产乱码久久久久久蜜柚 | 亚洲一区 中文字幕 | 一区二区蜜桃 | 天堂一区在线观看 | 精品成人佐山爱一区二区 | 日韩精品 电影一区 亚洲 | 国产一区二区三区色淫影院 | 国产情品 | 伊人免费在线 | 国产高清在线精品一区二区三区 | 免费av手机在线观看 | 一级欧美一级日韩片免费观看 | 久久精品欧美一区二区三区不卡 | 欧美成人自拍视频 | 99精品久久 | 黄色毛片大全 | 日韩美女在线看免费观看 | 国产毛片久久久 | 成人性视频在线 | 日本亚洲精品 | 欧美国产精品久久久 | 欧美福利精品 | 久草视频在线播放 | 成人在线视频免费看 | 成人毛片在线视频 | 国产亚洲欧美日韩精品一区二区三区 | 在线看av网址 | 亚洲高清在线 | 欧美亚洲国产一区 |