3 ms·
Here is one small example of something that won't be apparent to someone without a demonstration. Say I have a class called Foo and I realise, as I'm using it,
by nevster 16y ago
Here is one small example of something that won't be apparent to someone without a demonstration.
Say I have a class called Foo and I realise, as I'm using it, that I want to add a method called doSomethingElse, I can just type the new method call and have appCode create the method for me. Ie:
Foo *foo = [[Foo alloc] init];
[foo doSomething];
[foo doSomethingElse]
doSomethingElse would be marked in red. I just have to hit command-enter, select 'Create method' and appCode creates the method signature in Foo.h, creates the method in Foo.m and puts the cursor in the body of the method ready to implement it.
This improves coding flow remarkably.
- msbarnett 16y agoThat strikes me as a good example of where the kinds of features JetBrains is known for don't really mesh with Objective-C. If doSomethingElse is a method defined in a category I expect to be loaded at runtime, or something I expect to be caught by foo's forwardInvocation method, having it turn red and bug me to provide an implementation in Foo is exactly the wrong thing to do. It's the kind of little feature that really only makes sense in the context of a static language like C#, where a method call without a corresponding method implementation can be known definitively to be an error.
- nevster 16y agoThat's interesting but I'm confident in JetBrains getting this kind of detail right. I don't have appCode in front of me but I'm sure they'll implement something to handle it. They go to great lengths to understand your entire codebase including any libraries/sdks you might link with. They've had to do similar things already with Javascript, Ruby, etc. Even Java has similar issues - for example you can use reflection to call methods. So it may mark a method as not being used in your project. But for 99% of cases it gets it right.
- teaspoon 16y agoGCC would give a warning if you tried to compile this, and Xcode 4 would highlight the offending line with a yellow bubble. appCode's behavior doesn't seem too inappropriate in this case.
- nevster 16y agoNow that you mention this, I think it's highlighted in a muted color as a warning, not as a glaring red error.
- jcheng 16y agoTechnically C# isn't a static language anymore :) http://en.wikipedia.org/wiki/C_Sharp_4.0 http://en.wikipedia.org/wiki/C_Sharp_4.0