Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想执行以下代码:
methodName := thisContext sender method selector. aClass selectors do: [:current | current == methodName ifTrue: aBlock].
尽管字符串是相等的,但它永远不会进入“ifTrue”,我尝试将它们都转换为 ByteArray\String 并且它不起作用。关于如何比较它们的任何想法,以便我得到“ifTrue”?
您需要使用相等方法 (=) 而不是标识方法 (==) 进行比较。