Make CPBundle post a notification on successfull load

This commit is contained in:
Andreas authored and Andreas Falk committed 2010-11-13 15:38:14 +01:00
1 parent 8a75c9078e
commit 57c691c2e2
1 file changed
+7
+7
View File
@@ -22,8 +22,12 @@
@import "CPDictionary.j"
@import "CPObject.j"
@import "CPNotification.j"
@import "CPNotificationCenter.j"
CPBundleDidLoadNotification = "CPBundleDidLoadNotification";
/*!
@class CPBundle
@ingroup foundation
@@ -150,6 +154,9 @@ var CPBundlesForURLStrings = { };
_bundle.addEventListener("load", function()
{
[_delegate bundleDidFinishLoading:self];
// userInfo should contain a list of all classes loaded from this bundle. When writing this there
// seems to be no efficient way to get it though.
[[CPNotificationCenter defaultCenter] postNotificationName:CPBundleDidLoadNotification object:self userInfo:nil];
});
_bundle.addEventListener("error", function()