IOS development class forward reference
In addition to class extension, category also has powerful forward reference capabilities. For some private methods (not in. methods declared in the H file) if we want to use them, some of them use javasmselector to execute dynamic calls. In this way, private methods can be called completely, but this completely avoids the syntax check of the compiler, sometimes it may not be a good method. This problem can be solved by using category for forward reference.
Define an item class
@ Interface ZJItem: NSObject-(void) info; @ end
. M file
@ Implementation ZJItem-(void) info {NSLog (@ "this is in Interface part");}-(void) myPrivate {NSLog (@ "Your method");} @ end
We call it in the main function. First, do not use analogy for forward reference
The error message is displayed.
After adding a forward reference, the error disappears. <Strong? Http: www.bkjia.com kf ware vc "target =" _ blank "class =" keylink "> VcD4KPHA + pgltzybzcm9 "http://www.2cto.com/uploadfile/Collfiles/20150425/2015042508384087.png" alt = "">