为什么
switch ([document currentTool]) {
case DrawLine:
NSBezierPath * testPath = [[NSBezierPath alloc]init];
//...rest of code that uses testPath....
Run Code Online (Sandbox Code Playgroud)
造成
error:syntax error before "*" token
对于testPath?
我正在学习Objective-C和Cocoa(在时间允许时适合开始)所以请保持温和.
示例应用程序具有以下行:
NSPoint down = [mouseEvent locationInWindow];
//...some other stuff
NSPoint p = [self convertPoint:down fromView:nil];
Run Code Online (Sandbox Code Playgroud)
然后继续使用p进行拖放操作(使用pasteBoard).但是,我没有得到的是这一切都在一个视图中,为什么不只是使用down
,为什么一个convertPoint:
?还是我错过了一些基本的东西?
谢谢!
objective-c ×2