I've been slowly working my way through the examples in Beginning iPhone Development and there are a few things that I have not been able to figure out, but I'm sure you guys can help me with it.
- In Eclipse there is a Source->Generate Getters/Setters, can you do something similar to synthesize properties in Xcode
- I also cannot seem to find a Refactor menu
- I'm also struggling to find the equivalent to Source->Override/Implement Methods
--Edit-- I failed to describe my problem it seems. I do know that synthesizing properties will generate getters/setters for me, but I am look开发者_如何转开发ing for a way to generate the @property/@synthesize code, by selecting the variables.
Short list to start with, but I will probably have more as my confusion grows in might.
I will ignore that question and instead answer a different question:
Here is some stuff I found useful when I first got started
- Keyboard Shortcuts
- Custom Macros
And to directly address your question, check out Accessorizer
I've created a list about a lot of funcrions and features in Xcode which also contains a lot of features that you are used to in Eclipse (i'm using eclipse on a daily basis) which also include thins like displaying class hierarchy, search for classes, code completion, using Xcode with svn etc..
Xcode tips: http://www.sodeso.nl/?p=674
Using Xcode with svn: sodeso.nl/?p=599
There's no way built in Xcode to make proprieties in an automated manner.
However, user script can do this. Take a look at this article by Matt Gallagher.
In Eclipse there is a Source->Generate Getters/Setters, can you do something similar to synthesize properties in Xcode
AFAIK there isn't such a thing in Xcode. But synthesizing ObjC properties is simple, just add
@property(retain) NSArray* my_array;
in your @interface
and
@synthesize my_array;
in your @implementation
, if you want to generate getters and setters for my_array
.
I also cannot seem to find a Refactor menu
Edit -> Refactor (Shift-Cmd-J).
If you simply want to rename, mouse-click an identifier, wait for 1 seconds for a downward triangle to appear next to it, then click on it and choose "Edit All in Scope".
Generating getters and setters for properties is done with the @property
and the @synthesize
keywords.
Edit -> Refactor
Overriding methods is just writing the method name, you don't have to add @Override
like in Java.
精彩评论