O'Reilly logo

Sparrow iOS Game Framework Beginner's Guide by Johannes Stein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – managing remaining file types

To create an asset manager for our files, use the following steps:

  1. Add a new Objective-C class called FileManager, which is derived from AssetsDictionary within the Assets group.
  2. Define an instance method called registerPlainText, as shown in the following code:
    -(NSString *) registerPlainText:(NSString *)filename;
  3. Define another instance method called registerDictionaryFromJSON, as shown in the following code:
    -(NSDictionary *) registerDictionaryFromJSON:(NSString *)filename;
  4. Implement the registerPlainText method with the following content:
    if ([_dict valueForKey:filename] == nil) { NSString *path = [[NSBundle mainBundle] pathForResource:filename]; NSString *content = [NSString stringWithContentsOfFile:path ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required