We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
新人,直接学的swift,用了桥接把samurai-native引进来了,用swift重写catalog的,其他都好,就是Test_UITextField里报Use of unresolved identifier '$',求大神给个解决方法
The text was updated successfully, but these errors were encountered:
尝试了无数次,暂时解决了一下,但不优雅:
1.swift和objc混用的时候 typedef SamuraiHtmlRenderQuery * (^SamuraiHtmlRenderQueryBlockN)( id first, ... ); 这一句里的...会影响到,swift里不能调用ATTR、SET_CLASS、ADD_CLASS这几个大写的方法,把几个...去掉以后,再编译,就能调了
2.“$”还是不能用,试着用了__dollar(self.t1!),结果返回值是个function类型,尝试__dollar(self.t1!)(self.t1!)后,顺利得到SamuraiHtmlRenderQuery类型,之后使用 __dollar(self.t1!)(self.t1!).ADD_CLASS("error") 可以顺利让文本框变红
3.尝试用网上说的@asmname赋别名,失败 @asmname("__dollar") func $(context:AnyObject) -> SamuraiHtmlRenderQueryBlockN 没办法,只能用个func包了一下 func $(context:AnyObject) -> SamuraiHtmlRenderQuery{ return __dollar(self)(context) } 总算可以调用 $(self.t1!).ADD_CLASS("error")
Sorry, something went wrong.
No branches or pull requests
新人,直接学的swift,用了桥接把samurai-native引进来了,用swift重写catalog的,其他都好,就是Test_UITextField里报Use of unresolved identifier '$',求大神给个解决方法
The text was updated successfully, but these errors were encountered: