mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Improve reliability of methodSignatureForSelector.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9310 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
aab21f70fc
commit
097642b0d7
3 changed files with 18 additions and 17 deletions
|
@ -754,26 +754,16 @@ static BOOL deallocNotifications = NO;
|
|||
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector
|
||||
{
|
||||
const char *types;
|
||||
struct objc_method *mth;
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
types = NULL;
|
||||
#else
|
||||
types = aSelector->sel_types;
|
||||
#endif
|
||||
|
||||
if (types == 0)
|
||||
mth = (GSObjCIsInstance(self)
|
||||
? class_get_instance_method(GSObjCClass(self), aSelector)
|
||||
: class_get_class_method(GSObjCClass(self), aSelector));
|
||||
if (mth == 0)
|
||||
{
|
||||
struct objc_method *mth;
|
||||
|
||||
mth = (GSObjCIsInstance(self)
|
||||
? class_get_instance_method(GSObjCClass(self), aSelector)
|
||||
: class_get_class_method(GSObjCClass(self), aSelector));
|
||||
if (mth == 0)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
types = mth->method_types;
|
||||
return nil;
|
||||
}
|
||||
types = mth->method_types;
|
||||
return [NSMethodSignature signatureWithObjCTypes: types];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue