Graphics Programs Reference
In-Depth Information
ing initWithNibName:bundle: , it suggested this method before you could finish.
You can hit the Return key to accept Xcode 's suggestion or select another suggestion from
the pop-up box that appears.
However, there are two things to watch out for when using code-completion. First, when
you accept a code-completion suggestion for a method that takes arguments, Xcode puts
placeholders in the areas for the arguments.
Placeholders are not valid code, and you have to replace them to build the application.
This can be confusing because placeholders often have the same names that you want
your arguments to have. So the text of the code looks completely correct, but you get an
error.
Figure 1.19 shows two placeholders you might have seen when typing in the previous
code.
Figure 1.19 Example of code-completion placeholder and errors
See the nibNameOrNil and nibBundleOrNil in the first line of the implementation
of initWithNibName:bundle: ? Those are placeholders. You can tell because they
are inside slightly-shaded, rounded rectangles. The fix is to delete the placeholders and
type in arguments of your own (with the same names). The rounded rectangles will go
away, and your code will be correct and valid.
 
Search WWH ::




Custom Search