diff --git a/ChangeLog b/ChangeLog
index c5cc1c0..62bbf86 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-04-21 Phillipe Roussel
+
+ * Source/NSConnection+DBus.m: Move declarations before statements.
+
2012-03-25 Niels Grewe
* Headers/NSConnection+DBus.h
diff --git a/Source/NSConnection+DBus.m b/Source/NSConnection+DBus.m
index cd459c3..cb94927 100644
--- a/Source/NSConnection+DBus.m
+++ b/Source/NSConnection+DBus.m
@@ -49,20 +49,23 @@ static IMP _DKNSConnectionSetRootObject;
@implementation NSConnection (DBusKit)
+ (void)load
{
+ Method oldRootProxyMethod, newRootProxyMethod;
+ Method oldSetRootObjectMethod, newSetRootObjectMethod;
+
/*
* We do some devious patching and replace some method implementations in
* NSConnection with the ones from this category.
*/
rootProxySel = @selector(rootProxy);
setRootObjectSel = @selector(setRootObject:);
- Method oldRootProxyMethod =
+ oldRootProxyMethod =
class_getInstanceMethod(objc_getClass("NSConnection"), rootProxySel);
- Method newRootProxyMethod =
+ newRootProxyMethod =
class_getInstanceMethod(objc_getClass("NSConnection"),
@selector(_DKRootProxy));
- Method oldSetRootObjectMethod =
+ oldSetRootObjectMethod =
class_getInstanceMethod(objc_getClass("NSConnection"), setRootObjectSel);
- Method newSetRootObjectMethod =
+ newSetRootObjectMethod =
class_getInstanceMethod(objc_getClass("NSConnection"),
@selector(_DKSetRootObject:));
_DKNSConnectionRootProxy = method_getImplementation(oldRootProxyMethod);