Is performSelector in EDSortedArray safe?

Discussion of the EDMessage and EDCommon frameworks.

Is performSelector in EDSortedArray safe?

Postby Guest » 02 Feb 2011, 00:19

In [EDSortedArray _nodeForObject:], there is a line that says:

Code: Select all
r = (NSComparisonResult)[k performSelector:comparator withObject:x->object];


from the documentation of performSelector, it seems like you are only supposed to use it with methods that return an object, while here you use it with methods that return a NSComparisonResult (which is an integer). Is this safe? Couldn't it run into memory management issues, e.g. performSelector might think that the return result is an object, and retains/autoreleases it or something, which causes it to access the memory addressed by the integer, and crash?
Guest
 

Return to ED Frameworks



cron