堆栈设计中的不同层

时间:2017-04-20 07:36:04

标签: objective-c xib

您好我需要所谓的堆栈设计方面的帮助,在Xcode中的XIB文档中,您可以在不同的层中使用不同的层。

1 个答案:

答案 0 :(得分:-1)

如果你把它放在viewDidLoad下面它应该可以工作!

// Get the path


NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
NSString *documentPath = [paths objectAtIndex:0];
NSString *path = [documentPath stringByAppendingPathComponent:@"highscore.save"];

// Create a dictionary to hold objects
NSMutableDictionary* myDict = [[NSMutableDictionary alloc] init];

// Read objects back into dictionary
myDict = [NSKeyedUnarchiver unarchiveObjectWithFile:path];
NSString *nssHighscore = [myDict objectForKey:@"Highscore"];
highscore = [nssHighscore intValue];


gameState = kStateMenu;
ballVelocity = CGPointMake(0, 0);
gravity = CGPointMake(0, kGravity);
controlType = kTouch;