You can provision the data for the metadata-driven tile.
The code below defines a custom data object of the TimeSheetEntry type, and feeds the metadata-driven tile with this model. First, the data is converted from TimeSheetEntry to a TimeSheetEntryBO class that implements the MAFGenericBO protocol so that the Extensibility Framework can digest it.
The TimeSheetEntryBO must map the attributes to the ones defined in MAFGenericBO. For an example, look at the CustomAppUsingMAF demo app’s source.
// Create context from BOs // tseBO is an instance of TimeSheetEntryBO, which implements MAFGenericBO protocol NSMutableArray* items = [NSMutableArray arrayWithObject:tseBO]; // in this special case we have only one BO to bind MAFContext* context = [[MAFContext alloc] init]; [context setBOs:items ForBindingID:@"TimeSheetEntryRef"]; // Create the tile via MAF Extensibility MAFTile* subTile = [[MAFUIManager sharedInstance] tileByIdentifier:@"DetailTileNewWithCustomData" withContext:context]; subTile.view.frame = CGRectMake(30, 80, 320, 360); [self.view addSubview:subTile.view]; [context release];
A different initializer is used here, MAFUIManager + tileByIdentifier: withContext:, which passes the context for the tile to be created. The framework finishes the rest of the tile creation process.