开发者

Anyone done an Objective-C Xode version of Osherove´s TDD Kata "String Calculator"?

Always trying to code better and I am interested开发者_如何学JAVA in doing TDD for Objective-C and Xcode.

Do you know any post that implement something like Roy Osherove´s "String Calculator"-Kata

Update: trying to find out how to speed up TDD on iOS


I did that. You can find the screencast and the Xcode project here in my blog. I’ve written the text around it in german, but you should have no trouble playing the video or finding the download link.


I'd use NSPredicate like this:

NSPredicate * parsed = [NSPredicate predicateWithFormat:@"6 * 7 = 0"];
NSExpression * left = [(NSComparisonPredicate *)parsed leftExpression];
NSNumber * result = [left expressionValueWithObject:nil context:nil];
NSLog(@"result: %@", result);

Look here for more info on using NSPredicate in weird ways.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜