On 17 Dec 08, at 13:22, Ken Thomases wrote:
if ([[textField stringValue] isEqualTo: @"0:00:00" || @"0.00000" ]) {

What's up with the above line? First, you should be careful about which isEqual... method you use. -isEqual: is a generic method for comparing any two objects. Since you know you're comparing strings, you should use -isEqualToString:. Don't use -isEqualTo: unless you're specifically working with scripting -- it's scripting- specific, although in most cases it is equivalent to -isEqual:.

And, while we're at it, the logic in this line appears to indicate that you're using a text field to store model data, which is Bad. This sort of information belongs in the controller, not in the view... review your MVC.
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to