41 return [[
self alloc] initWithURL:aURL];
51 var bundle = CFBundle.bundleWithIdentifier(anIdentifier);
55 var url = bundle.bundleURL(),
69 return [
self bundleWithURL:CFBundle.bundleForClass(aClass).bundleURL()];
79 aURL =
new CFURL(aURL);
85 return existingBundle;
91 _bundle =
new CFBundle(aURL);
125 return _bundle.resourcesDirectoryURL();
128 - (Class)principalClass
139 return _bundle.identifier();
149 return _bundle.pathForResource(aFilename);
159 return _bundle.valueForInfoDictionaryKey(aKey);
162 - (void)loadWithDelegate:(
id)aDelegate
164 _delegate = aDelegate;
166 _bundle.addEventListener(
"load",
function()
168 [_delegate bundleDidFinishLoading:self];
174 _bundle.addEventListener(
"error",
function()
176 CPLog.error(
"Could not find bundle: " +
self);
182 - (CPArray)staticResourceURLs
184 var staticResourceURLs = [],
185 staticResources = _bundle.staticResources(),
187 count = [staticResources count];
189 for (; index < count; ++index)
190 [staticResourceURLs addObject:staticResources[index].URL()];
192 return staticResourceURLs;
195 - (CPArray)environments