xcode6.3 - Swift 1.2 cannot invoke 'count' with an argument list of type '(String)' -
updated xcode 6.3.1 new swift 1.2, old method countelement change count, when switch use count, throw out error message:
cannot invoke 'count' argument list of type '(string)'
this snippet copied apple doc, still not working.
func printandcount(stringtoprint: string) -> int { println(stringtoprint) return count(stringtoprint) } func printwithoutcounting(stringtoprint: string) { printandcount(stringtoprint) } printandcount("hello, world")
try calling global count function swift module prefix this:
swift.count(stringtopoint)
e.g. when extending array type there property named count , there naming conflict.
Comments
Post a Comment