2011年4月27日 星期三

view switcher(二)-SwitchViewControllerAppDelegate

開啓新專案, 選擇 Window-based Application, 分別建立3個UIViewController subclass (不含xib);
1. SwitchViewController
2. BlueViewController
3. YellowViewController
再建立2個xib
1. BlueView
2. YellowView

//

// SwitchViewControllerAppDelegate.h

#import

@class SwitchViewController;

@interface SwitchViewControllerAppDelegate : NSObject {

UIWindow *window;

SwitchViewController *_switchViewController;

}

@property (nonatomic, retain) IBOutlet UIWindow *window;

@property (nonatomic, retain) IBOutlet SwitchViewController *_switchViewController;

@end

剛剛輸入的IBOutlet宣告目的是在 應用程式啓動時 將root controller(_switchViewController)的view加入到應用程式的主視窗, 所以必須建立IBOutlet

//

// SwitchViewControllerAppDelegate.m

#import "SwitchViewControllerAppDelegate.h"

#import "SwitchViewController.h"

@implementation SwitchViewControllerAppDelegate

@synthesize window;

@synthesize _switchViewController;

#pragma mark -

#pragma mark Application lifecycle

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

// Override point for customization after application launch.

[self.window addSubview:_switchViewController.view];

[self.window makeKeyAndVisible];

return YES;

}

- (void)dealloc {

[window release];

[_switchViewController release];

[super dealloc];

}

@end

view switcher (一)

探索iPhone程式開發實戰chapter 6心得:
切換兩個view, 分別是藍色背景與黃色背景的view, 使用了3個view controller,

2011年4月25日 星期一

Windows XP 網際網路連線共享 (Internet Connection Sharing, ICS) 之設定

使用電腦(A)的無線網路接收訊號 , 再經由RJ45接線給其他電腦(B)上網使用,
兩台電腦可同時透過wireless上網
wireless --> PC(A) -->wire --> PC(B)
這裡要選擇已經連上線的無線網卡
要選擇接線方式提供網路訊號給其他電腦的網路連線

google document test