Re: [請益] 沒有想像中簡單的小問題

看板Programming作者 (○(* ̄中肯 ̄*)○)時間16年前 (2009/03/23 23:12), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串15/34 (看更多)
用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

03/24 01:16, , 1F
就算現在看到MIPS都不驚訝了
03/24 01:16, 1F

03/25 00:33, , 2F
是 plover 耶!!!!! (瘋狂 XD
03/25 00:33, 2F
文章代碼(AID): #19nwRdM5 (Programming)
討論串 (同標題文章)
文章代碼(AID): #19nwRdM5 (Programming)