【问题标题】:Different Layers in a Stack Design堆栈设计中的不同层
【发布时间】:2017-09-16 16:57:19
【问题描述】:

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

【问题讨论】:

  • 欢迎来到 Stack Overflow。目前尚不清楚您在问什么以及下面的答案如何解决您的问题。也许您应该先阅读“How do I ask a good question?”。

标签: objective-c xib


【解决方案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;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-05-07
    • 1970-01-01
    • 1970-01-01
    • 2013-05-03
    • 1970-01-01
    • 1970-01-01
    • 2022-11-04
    相关资源
    最近更新 更多