Is there a shortcut to add properties in Xcode 4?

In Visual Studio, if I type prop and click on a tab, then the property is created for me, I just have to fill in the details. Is there something similar in Xcode 4?

I understand that a similar question is asked here: Xcode script for generating / synthesizing properties , but it seems to refer to Xcode 3, judging by the date.

Thanks Gareth

+4
source share
2 answers

In Xcode4, you can add a property, create ivar, receive release calls in dealloc, and set nil to viewDidUnload all by simply dragging the user interface component from the XIB editor into your view controller header file. All you have to do is name the property, and Xcode4 does the rest for you. Nice!

Unfortunately, if you just want to manually add a property, create a related ivar and manage memory in an arbitrary class, there is no way to do this. At least I have not found anywhere! Of course, the completion of the smart code is an improvement, but not like an intelligent operation, to add a boiler room to add a property.

+4
source

Code completion in Xcode 4 has improved significantly. Just start typing @prop ... and fill out the header file. THEN switch to your implementation file and run the @syn type ... and you're done.

+1
source

Source: https://habr.com/ru/post/1345381/


All Articles