objc2
objc2 copied to clipboard
Some suggestions regarding objc2-foundation and block2
-
When using NSArray or NSDictionary, their values are usually generic types, so they need to be defined using AnyObject, such as
NSMutableDictionary::<NSString, AnyObject>
. However, for types like NSNumber, multiple calls tointo_super
or unsafe methods such asId::cast
are required to convert them to AnyObject. Considering the frequency of this operation, could a safe method be provided to complete the conversion from NSNumber to AnyObject in one step? -
When using many Apple frameworks, it is necessary to pass the static CFString exported from the framework to NSString. Could a method be added for NSString, create NString from a raw pointer?
-
When using block2, all parameter and return value types must implement Encode trait, but many Apple frameworks do not use Objective-C interfaces and types. Could a feature be added to block2 to allow it to be used in C interface framework wrappers, replace block?