You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Methods like NSAccessibilityElement::accessibilityElementWithRole_frame_label_parent or NSResponder::insertTab take &AnyObject.
This means that they can assume very little about the object, but that's usually fine, as it's only really used in user-implemented methods (I think?).
Can we allow such methods to be safe? What about if I were to pass a &NSMutableString? Would that still be safe because I/the method can't recover the mutable string, or would safety be broken here?
Related is methods like NSError::initWithDomain_code_userInfo or NSAttributedString::initWithString_attributes, which accept NSDictionary<SomeKey, AnyObject>, and expect the user to pass the correct type for a given key.
Does Foundation assert that the attributes are the correct type? If so, can we allow these methods to be safe?
The text was updated successfully, but these errors were encountered:
Methods like
NSAccessibilityElement::accessibilityElementWithRole_frame_label_parent
orNSResponder::insertTab
take&AnyObject
.This means that they can assume very little about the object, but that's usually fine, as it's only really used in user-implemented methods (I think?).
Can we allow such methods to be safe? What about if I were to pass a
&NSMutableString
? Would that still be safe because I/the method can't recover the mutable string, or would safety be broken here?Related is methods like
NSError::initWithDomain_code_userInfo
orNSAttributedString::initWithString_attributes
, which acceptNSDictionary<SomeKey, AnyObject>
, and expect the user to pass the correct type for a given key.Does
Foundation
assert that the attributes are the correct type? If so, can we allow these methods to be safe?The text was updated successfully, but these errors were encountered: