
Doesteivsky
|
Posted - 2008.12.14 01:33:00 -
[1]
Made some quick changes...
First made it so it no longer compiles with warnings, second included the missing SM2DGraphView framework. As both changes are very light (took me 10 min), I'll just tell you how to do them and then someone that has access can update the main repository:
As part of my job is to make comments on source code, forgive me for doing the same here.
1.) NULL is a C defined macro that translates to 0 however, Objective-C is like Java in that it's very type specific. So while passing NULL might be correct behavior, it's going to translate to a safe to ignore warning message about sending an int a pointer. 2.) watch your types. when passing objects be sure that you either cast it appropriately so not only the compiler but also a human can tell it's being typecast. 3.) While it's good that you're catching the NSTimer output, it's bad to not check it for errors. In general, I'd watch out for setting variables and never checking them. 4.) There's a number of race condition problems inherit in making an Objective-C program look very C like. Not your fault at all, it's common among first time Objective-C programmers. Just watch the callbacks and make certain that you don't allow an object to die without checking it. 5.) Objective-C does have a garbage collector, but in order for it to be used, objects must be in an autoreleasepool and be set to nil. 6.) Prior to making a release, I suggest putting some effort into putting the files into folders, when you re-import them into XCode, they'll automatically be grouped. 7.) Anytime you use a framework that isn't part of the target platform already there, make certain to embed it (instructions below):
a) open the xcode environment with your project's xcodeproj b) expand the Frameworks tab (one that looks like a folder in the left hand pane) c) expand the targets tab then the skill monitor cocoa tab d) finally expand the copy files tab now drag and drop your framework into this dropped list.
Now when you build, the framework will be automatically included and your users can just use your program.
Message me if you have any questions. I'm headed into crunch time pretty soon, but I'd be happy to give pointers and suggestions. When I have more time, I'll even contribute some code. Overall, a great idea, well done, and quite impressive first Objective-C project. By the way, I didn't notice anything that would prevent this from being used on the iPhone or iTouch, a minor rewrite and it should do fine there.
p.s. a fun yet time consuming task would be to simplify the code and make it more object oriented. Try to use messages and I think you'll notice that it becomes easier to write; plus you'll have a much smaller code base.
|