Obtain details of categories on a class at runtime?
In Objective-C, is there a way to list the categories on a particular class at runtime?
With the Objective-C runtime functions I can obtain details for the class and instance methods, class hierarchy, instance variables, etc. but seemingly not the category information.
Looking at F-Script, I see that it doesn’t display category information (indeed, it appears not to display methods from categories at all). On the other hand, class-dump extracts category information but this is from the binary and not at runtime.
There’s a mention of struct objc_category in objc/runtime.h but this looks to be private. Is there a supported way?
- UIStoryboard: What's the Correct Way to Get the Active Storyboard?
- Swift Objective-C runtime class naming
- How to configure independent sets of runtime settings in XCode
- How do I print the values of all declared properties of an NSObject?
- iOS - Linking framework storyboard to ViewController for use in main project
- Are objective-c objects all same type of C-structure?
Solutions Collect From Internet About “Obtain details of categories on a class at runtime?”
from “The Objective-C Programming Language” in the SDK doc:
Category methods can do anything that methods defined in the class proper can do. At runtime, there’s no difference.
the support for objc_category struct has been removed with modern objective-c (ios, 10.5), making this information opaque.
I’m afraid you can’t get the information you want.
- Update Badge Number when push notification is received when App is not Open
- layoutManager boundingRectForGlyphRange:inTextContainer: does not work for all strings
- Sort NSDictionaries in NSMutableArray by NSDate
- Deleting plist file does not reset app on macOS 10.9+
- NSClassFromString returns nil
- UIImageView with Aspect Fill inside custom UITableViewCell using AutoLayout
- Get number of days between two NSDate dates in a particular timezone
- What is the cause of this type error?
- Setting size to custom iOS font doesnt work
- Reloading a ViewController
- iOS 11 – Location update not received after adding delegate
- In Objective-c how can we have a variable whose scope is the whole class (but doesn't include subclasses)
- How to support iOs 9 feature(s), while keeping iOs 8 support?
- Pass data between UITabBarController views
- Realtime audio processing without output