<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">--- NSObject+Extensions.m.orig	2003-12-15 15:17:28.000000000 +1100
+++ NSObject+Extensions.m	2012-04-02 10:04:35.000000000 +1000
@@ -89,22 +89,23 @@ IMP EDGetFirstUnusedIMPForSelector(Class
 {
 #ifndef GNU_RUNTIME
     IMP						activeIMP;
-    struct objc_method_list	*mlist;
     void					*iterator;
     int						i;
-
+	Method					*methlist;
+	int						count;
+	
     if(isClassMethod)
         aClass = aClass-&gt;isa;
     iterator = 0;
     activeIMP = [aClass instanceMethodForSelector:aSelector];
-    while((mlist = class_nextMethodList(aClass, &amp;iterator)) != NULL)
-        {
-        for(i = 0; i &lt; mlist-&gt;method_count; i++)
-            {
-            if((mlist-&gt;method_list[i].method_name == aSelector) &amp;&amp; (mlist-&gt;method_list[i].method_imp != activeIMP))
-                return mlist-&gt;method_list[i].method_imp;
-            }
-        }
+	methlist = class_copyMethodList(aClass, &amp;count);
+	for (i = 0; i &lt; count; i++) {
+		if((method_getName(methlist[i]) == aSelector) &amp;&amp; (method_getImplementation(methlist[i]) != activeIMP)) {
+			IMP unused = method_getImplementation(methlist[i]);
+			free(methlist);
+		}
+	}
+	free(methlist);
     return NULL;
 #else /* GNU_RUNTIME */
 #warning ** implementation missing for GNU runtime
</pre></body></html>