How can I make Xcode autocomplete a @property
directive?
I saw it on someone's Mac.
As Alladinian already mentioned in a comment, you can achieve this with a custom "Code Snippet" in Xcode. To define a code snippet, you first type the text in a source file, for example
@property (nonatomic, strong) <#type#> *<#name#>;
(<#...#>
is a special placeholder, so that you can jump to "type" and "name" using the
tabulator key later.)
Then you select the entire line, and drag it to the "Code Snippet Library":
Double-click on the new code snippet, and give it a name and a shortcut:
Now, when you type the shortcut, Xcode will offer the completion:
Select your code snippet, and it will be inserted in the source file:
You can use the tabulator to jump to "type" and "name".
Check the box shown in RedBox, your XCode autocompletion will work
EDIT:
If you are able to see in .m file, then surely your .h contains some syntax error. Due to that error LLVM compiler shows signal to correct and your autocompletion is not working.
EDIT 2:
As per your comment, while typing @prop
the autocompletion does not show erty(,)
even in XCode4.6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With