看板 Programming 關於我們 聯絡資訊
用iPhone SDK寫的.. main.m ------ #import <UIKit/UIKit.h> int main(int argc, char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int retVal = UIApplicationMain(argc, argv, nil, @"HelloWorldAppDelegate"); [pool release]; return retVal; } HelloWorldAppDelegate.h ----------------------- #import <UIKit/UIKit.h> @interface MainView : UIView { UITextView *textView; } @end @interface HelloWorldAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; MainView *myMainView; } @property (nonatomic, retain) IBOutlet UIWindow *window; @end HelloWorldAppDelegate.m ----------------------- #import <UIKit/UITextView.h> #import <UIKit/UIColor.h> #import <UIKit/UIFont.h> #import "HelloWorldAppDelegate.h" @implementation MainView -(id)initWithFrame:(CGRect) rect { self = [super initWithFrame: rect]; if (self!=nil) { textView = [[UITextView alloc] initWithFrame: rect]; textView.text = @" 3\n 345\n34567\n 345\n 3"; [self addSubview: textView]; } return self; } -(void)dealloc { [textView release]; [super dealloc]; } @end @implementation HelloWorldAppDelegate @synthesize window; - (void)applicationDidFinishLaunching:(UIApplication *)application { CGRect screenBounds = [[UIScreen mainScreen] applicationFrame]; CGRect windowBounds = screenBounds; windowBounds.origin.y = 0.0; self.window = [[[UIWindow alloc] initWithFrame: screenBounds] autorelease ]; myMainView = [[MainView alloc] initWithFrame: windowBounds]; [window addSubview: myMainView]; [window makeKeyAndVisible]; } - (void)dealloc { [myMainView release]; [window release]; [super dealloc]; } @end -- 賺賺稿費 XD -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.45.230.90
hala932:就算現在看到MIPS都不驚訝了 123.192.12.32 03/24 01:16
yoco315:是 plover 耶!!!!! (瘋狂 XD 118.160.109.50 03/25 00:33