• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: get class of a method's returned object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: get class of a method's returned object


  • Subject: Re: get class of a method's returned object
  • From: Kyle Sluder <email@hidden>
  • Date: Mon, 23 Feb 2015 15:45:59 -0600

On Mon, Feb 23, 2015, at 03:22 PM, BareFeetWare wrote:
> @interface NSObject (Private)
> - (NSString *) _shortMethodDescription;
> @end
>
> NSString *fullMethodList = [[self class] _shortMethodDescription];
>
> which gives the full header breakdown of methods with parameters and
> return classes.

I have no idea what method that is, but it is not part of Apple's
frameworks:

% cat /tmp/foo.m
#import <Foundation/Foundation.h>

@interface NSObject (Private)
+ (NSString *)_shortMethodDescription;
@end

int main(int argc, char **argv) {
	NSLog(@"%@", [[NSObject class] _shortMethodDescription]);
	return 0;
}

% clang -o /tmp/foo /tmp/foo.m -framework Foundation
% /tmp/foo
2015-02-23 13:44:52.996 foo[42837:637961] +[NSObject
_shortMethodDescription]: unrecognized selector sent to class
0x7fff7a89d0f0
2015-02-23 13:44:52.998 foo[42837:637961] *** Terminating app due to
uncaught exception 'NSInvalidArgumentException', reason: '+[NSObject
_shortMethodDescription]: unrecognized selector sent to class
0x7fff7a89d0f0'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff8913050c
	__exceptionPreprocess + 172
	1   libobjc.A.dylib                     0x00007fff9668276e
	objc_exception_throw + 43
	2   CoreFoundation                      0x00007fff8913347d
	+[NSObject(NSObject) doesNotRecognizeSelector:] + 205
	3   CoreFoundation                      0x00007fff89079524
	___forwarding___ + 1028
	4   CoreFoundation                      0x00007fff89079098
	_CF_forwarding_prep_0 + 120
	5   foo                                 0x00000001045d1f2e main
	+ 62
	6   libdyld.dylib                       0x00007fff90ca95c9 start
	+ 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
zsh: abort      /tmp/foo

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: get class of a method's returned object
      • From: Kyle Sluder <email@hidden>
References: 
 >get class of a method (From: BareFeetWare <email@hidden>)
 >Re: get class of a method (From: Kyle Sluder <email@hidden>)
 >Re: get class of a method's returned object (From: BareFeetWare <email@hidden>)

  • Prev by Date: Re: get class of a method's returned object
  • Next by Date: Re: Instantiate NSString from NSURL in Swift
  • Previous by thread: Re: get class of a method's returned object
  • Next by thread: Re: get class of a method's returned object
  • Index(es):
    • Date
    • Thread