You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you really need to provide data and filters in separate containers, here is a way to do it:
// One container for data...id data = @{@"alert": @{ @"label": @"label.screen.reporting.content.label.alerts", @"allalerts": allalerts, } };
// A second container for filters (NSDateFormatter is already a filter since v6.4):id filters = @{@"dateFormat" : self.dateFormatter };
// RenderingNSString *rendering = [template renderObjectsFromArray:@[filters, data] error:NULL];
The more I think of it, the more I believe you are using an old version of GRMustache. The documentation for it is in the distribution itself (check the Guides folder). This website shows the documentation for the latest version of the library. If this does not answer your question, feel free to reopen this issue.
Need to render object with filters defined separately with the method :
like this
GRMustacheTemplate *template = [GRMustacheTemplate templateFromResource:@"reportTemplate" bundle:nil error:NULL];
NSString *rendering = [template renderObject:@{@"alert":
@{
@"label": @"label.screen.reporting.content.label.alerts",
@"allalerts": allalerts,
}
} withFilters:@{@"dateFormat" : [GRMustacheFilter filterWithBlock:^id(id object) {
return [self.dateFormatter stringFromDate:object];}] } ];
{{ dateFormat(aircraftGPSPoint.timestamp) }}
else I never manage to render object with a filter
The text was updated successfully, but these errors were encountered: