成人免费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-05-31 16:47:47

SEO

2011-06-27 14:56:46

Qt Designer

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技術棧公眾號

主站蜘蛛池模板: 日韩1区| 九九热精品免费 | 欧美影院 | 国产精品一区二区三区久久久 | 久久国产一区二区三区 | 国产目拍亚洲精品99久久精品 | 亚洲视频欧美视频 | 两性午夜视频 | 色婷婷综合久久久中文字幕 | 国产精品99免费视频 | 荷兰欧美一级毛片 | 国产精品久久国产精品久久 | 国产成人精品一区二区三区 | 日韩欧美精品一区 | 国产96在线 | 91成人午夜性a一级毛片 | 特级做a爱片免费69 精品国产鲁一鲁一区二区张丽 | 国产精品18hdxxxⅹ在线 | 天天干天天想 | 91精品国产欧美一区二区成人 | 色橹橹欧美在线观看视频高清 | 中文字幕 国产 | 久久精品视频在线观看 | 99精品视频免费观看 | 亚洲一区二区三区久久久 | 麻豆视频在线免费观看 | 欧美一区二区在线观看视频 | 久久99蜜桃综合影院免费观看 | 欧美人妇做爰xxxⅹ性高电影 | 久久综合久色欧美综合狠狠 | 蜜月aⅴ免费一区二区三区 99re在线视频 | 日韩国产黄色片 | 亚洲精品丝袜日韩 | 日韩精品成人 | 午夜不卡福利视频 | 国产成人免费视频网站高清观看视频 | 人人爽人人爽人人片av | av在线播放一区二区 | 国产羞羞视频在线观看 | 欧美一级二级三级 | 91香蕉视频在线观看 |