2012-11-18 48 views

回答

5

明白了。兩者都需要被覆蓋。

- (void)editWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject event:(NSEvent *)theEvent 
{ 
    aRect.origin.y += 9; 
    aRect.origin.x += 10; 
    [super editWithFrame:aRect inView:controlView editor:textObj delegate:anObject event:theEvent]; 
} 

- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject start:(NSInteger)selStart length:(NSInteger)selLength 
{ 
    aRect.origin.y += 9; 
    aRect.origin.x += 10; 
    [super selectWithFrame:aRect inView:controlView editor:textObj delegate:anObject start:selStart length:selLength]; 
} 
相關問題