I’m reading a project code from others, it could be compiled successfully in 32bit, but when I switch the project to 64bit, there is one error message just like the title said.
code:
[obj setAction:(SEL)@selector(start:)];
I know the return value type of @selector is SEL and the parameter of setAction needs a SEL args, but why it failed in 64bit? What’s the SEL type actually?
Thanks!
It should not fail, but you don’t need the cast at all.
@selector()expressions are already of typeSEL. Just writeThe SEL type is, in terms of C,
struct objc_selector *. On OS X and iOS, it is, however? backed by a plainconst char *, which is unified by the linker and the kernel during loading time.