-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMCCBundleFileManager.m
More file actions
45 lines (34 loc) · 908 Bytes
/
MCCBundleFileManager.m
File metadata and controls
45 lines (34 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// MCCBundleFileManager.m
// Tealeaves
//
// Created by Scott Little on 30/5/14.
// Copyright (c) 2014 Little Known Software. All rights reserved.
//
#import "MCCBundleFileManager.h"
@interface MCC_PREFIXED_NAME(BundleFileManager) ()
@property (strong) NSString *bundleName;
@end
@implementation MCC_PREFIXED_NAME(BundleFileManager)
- (instancetype)initWithBundleId:(NSString *)aBundleId {
self = [super init];
if (self) {
if (aBundleId && ([aBundleId length] > 0)) {
self.bundleName = aBundleId;
}
else {
self.bundleName = [[NSBundle bundleForClass:[self class]] objectForInfoDictionaryKey:@"CFBundleIdentifier"];
if (self.bundleName == nil) {
self.bundleName = [[NSProcessInfo processInfo] processName];
}
if (self.bundleName == nil) {
self.bundleName = @"";
}
}
}
return self;
}
- (NSString *)applicationName {
return self.bundleName;
}
@end