私のプロジェクトでは、SKView と標準の NSView オブジェクトを 1 つのウィンドウに混在させています。そして今、SKscene (mouseDown の場所) からいくつかの情報を取得して、skview オブジェクトの近くのラベルに表示しようとしています。グローバル変数を使用して、skviewメソッドで値を割り当てようとしました
-(void)mouseDown:(NSEvent *)theEvent{
CGPoint location = [theEvent locationInNode:(self)];
// location = (10, 15) - example
currentPointPosition = CGPointMake(location.x, location.y);
//currentPointPosition = (10, 15)
}
しかし、次のように nsbutton からチェックすると:
- (IBAction) updateButton:(id)sender {
NSLog(@"currentPoint over skview methods:
%0.3f : %0.3f", currentPointPosition.x, currentPointPosition.y);
//currentPointPosition = (0, 0)
//other code
}
...初期化(廃止)後のように残ります。
これらの技術を混在させることさえ可能ですか?
ps: 私の英語でごめんなさい
プロジェクト画面: http://s8.postimg.org/kdmu36h6d/2014_09_19_20_02_30.png