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?
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.
- UIViewController viewDidLoad vs. viewWillAppear: What is the proper division of labor?
- Use of unresolved identifier NSCalendarUnitDay
- Alternative to switch statement in objective C
- How to get managedObjectContext for viewController other than getting it from appDelegate?
- “Push” animation in Objective-C
- How to get position of an element in UIWebView?
- Passing Data between View Controllers : from uitableview to a details view controller
- swift – UILabel text not renderer when using renderInContext asynchronously
- Best way to save data on the iPhone
- IOS 7 interactivePopGestureRecognizer is freezing app
- How to fix ERROR ITMS-90032: “Invalid Image Path – No image found at the path referenced under key 'CFBundleIcons': 'AppIcon60x60'”?
- Oracle access from iOS
- How to track a user's location and display the path travelled using Google Maps ios SDK
- Strange behaviour on table view with core data
- Disable swipe back gesture in Swift