Which way is recommended for declare a local node?
(1) inside interface in the header file
@interface MyScene() <SKPhysicsContactDelegate>
@property (nonatomic) SKSpriteNode *player;
@end
(2) inside interface in the implementation file
@interface MyScene()
@property (nonatomic) SKSpriteNode *player;
@end
(3) inside implementation in the implementation file
@implementation MyScene
{
SKSpriteNode *_player;
}
Thanks.
If you want the long answer you can read it here . if you prefer the short answer it is your third option: inside implementation in the implementation file.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.