Feeding the Tile with Custom Data

You can provide custom data for specific tiles, that is, you can feed the tile with custom data from a database of your choice.

To use a global custom datasource adapter, implement a class that adheres to the MAFDataSourceAdapter protocol, using either the MAFCore –setDataSourceAdapter: API, or the MAFCore -loadWithWindow:dataSourceAdapter:andCompletionBlock: API. You can do this by implementing the MAFTileDataSourceDelegate, which exposes three optional delegate methods:
  • - (void) willLoadContext:(MAFContext**)context_in_out forTile:(MAFTile*)tile_in;

    This delegate is invoked before the context loading starts. It allows you to replace or modify the context.

  • - (void) didLoadContext:(MAFContext*)context_in forTile:(MAFTile*)tile_in;

    The framework calls this delegate after the context loading completes.

  • - (void) loadContextForMAFTile:(MAFTile*)tile_in failedWithError:(NSError*)error_in;

    Implement this delegate to be notified about context loading issues. The error parameters contain information about the error. The delegate is invoked only if errors exist.

You can register datasource delegates via the MAFTileCreatorDelegate’s registerDataSourceDelegateForTile: API.