1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-27 15:50:56 +00:00
CLK/OSBindings/Mac/Clock Signal/Machine/NSBundle+DataResource.m

20 lines
523 B
Mathematica
Raw Normal View History

//
// NSBundle+DataResource.m
// Clock Signal
//
// Created by Thomas Harte on 02/10/2016.
// Copyright 2016 Thomas Harte. All rights reserved.
//
#import "NSBundle+DataResource.h"
@implementation NSBundle (DataResource)
2018-01-01 21:04:13 +00:00
- (NSData *)dataForResource:(NSString *)resource withExtension:(NSString *)extension subdirectory:(NSString *)subdirectory {
NSURL *url = [self URLForResource:resource withExtension:extension subdirectory:subdirectory];
if(!url) return nil;
return [NSData dataWithContentsOfURL:url];
}
@end