More recently, the next WWDC has been completed, which is an important and noticeable event for everyone who works with Apple products, who writes for OS X and iOS, for Safari, and so on. I would like to share what I liked in the IDE Xcode and in Objective-C.
I'll start with the language. So we have new abstractions - literals (Literals) that make it much easier and more convenient to describe such data types as numbers, dictionaries (Dictionary) and arrays (array).
Compare:
NSNumber *myNum = [NSNumber numberWithInt:12]; NSDictionary *myDict = [NSDictionary dictionaryWithObjectsAndKeys:@"one", @"first", @"two", @"second", nil]; NSArray *myArr = [NSArray arrayWithObjects:@"one", @"two", @"three", nil];
And in the new version:
NSNumber *myNum = @12;
As 1101_debian told me now, it is much more convenient to access the elements of an array or a dictionary:
')
myArr[0] myArr[5] myDict[@"Fuu"]
In my opinion it is much more convenient and clearer. Something reminded me of Perl, which for me is the standard of competent organization of the language, concise and convenient. And one more small change, now when typing NSS the hint will suggest the NSString in the first place, or rather the first option that is most often used is suggested. I understand why it caused applause at the presentation.
Next is the declaration of properties in the class. Now it is not necessary to set @synthetize, it will be set by default. That is, simply declare the property in the interface.
@property(copy) NSString *myString;
A lot of new added to the search. The ability to search by regular expression or by drawing up rules (and, or, not ...), search and replace only in the selected fragment and much more. We must try all this pens.
A lot of changes happened in the visual interface editor (interface builder). Now all the work with the location, size of elements, the rules of their scaling and alignment when changing orientation is performed much easier and clearer. Although, of course, we should get used to it.
Also error messages and warnings became more informative. Now they point to a specific place in the line where there is a problem. Well, to the heap, when auto-completing the code, there is also contextual help, until I know whether it is necessary.
They added automatic cleaning of spaces to the end of lines, they also improved the code anilizer, which earlier helped to get rid of the mass of possible memory leaks, especially in large projects written "by everyone and no one."
In the version control system added the ability to exclude the selected fragment from the current commit. For me - a very convenient feature with reasonable use.
In the future (next year), a complete rejection of the obsolete compiler (LLVM-GCC) and debugger (GDB) is promised. I do not use them in my work, so it’s hard for me to judge how it will be for the good. For the development of Xcode and Objective-C - this is certainly a plus, no need to drag further compatibility with you.
In general, there are many changes, most useful and expected, it remains to wait for the release of the new Xcode to start working with all this.
It is possible that I missed something, so I will be glad to your comments.
Based on materials
WWDC 2012.