obj-c和Cocoa摸了一个多礼拜了...上周末开始尝试做第一个小东西...
没想到简单的移动都搞了很久...今天晚上又仔细看了看相关的API文档...终于搞定了...
要点记下...
- NSTimer 要用+ (NSTimer *)scheduledTimerWithTimeInterval:来initiate才会放到RunLoop里去正常执行;
- NSView的移动 要记得先redraw superview...
[[theView superview] setNeedsDisplayInRect:[theView frame]]; [theView setFrame:newFrame]; [theView setNeedsDisplay:YES];
No comments:
Post a Comment