myexample.m
来自「iPhone development example: Tables.」· M 代码 · 共 52 行
M
52 行
#import "MyExample.h"int main(int argc, char **argv){ NSAutoreleasePool *autoreleasePool = [ [ NSAutoreleasePool alloc ] init ]; int returnCode = UIApplicationMain(argc, argv, [ MyApp class ]); [ autoreleasePool release ]; return returnCode;}@implementation MyApp- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { window = [ [ UIWindow alloc ] initWithContentRect: [ UIHardware fullScreenApplicationContentRect ] ]; CGRect rect = [ UIHardware fullScreenApplicationContentRect ]; rect.origin.x = rect.origin.y = 0.0f; mainView = [ [ MainView alloc ] initWithFrame: rect ]; [ window setContentView: mainView ]; [ window orderFront: self ]; [ window makeKey: self ]; [ window _setHidden: NO ];}@end@implementation MainView- (id)initWithFrame:(CGRect)rect { self = [ super initWithFrame: rect ]; if (nil != self) { fileTable = [ [ FileTable alloc ] initWithFrame: rect ]; [ fileTable setPath: @"/Applications" ]; [ fileTable setExtension: @"app" ]; [ fileTable reloadData ]; [ self addSubview: fileTable ]; } return self;}- (void)dealloc{ [ self dealloc ]; [ super dealloc ];}@end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?