Created
March 6, 2014 09:07
-
-
Save iurimatias/9385800 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyExtension | |
def [](index) | |
#this works in iOS but in OSX self is treted as a Fixnum | |
self.indexAtPosition(index) | |
end | |
end | |
class NSIndexPath | |
include MyExtension | |
end | |
index_path = NSIndexPath.indexPathWithIndex(3) | |
index_path[0] #=> works in iOS but fails in OSX | |
#iOS => returns 3 | |
#OSX => #<NoMethodError: undefined method `indexAtPosition' for 826:Fixnum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment