你如何将其转化为目标C?

时间:2010-11-23 08:41:28

标签: python objective-c oop

class MyClass():
    def printer(name="abc", description="123")
        print name + description

这是python ......你怎么能把它翻译成目标C?

1 个答案:

答案 0 :(得分:2)

这样的事情会让你开始:

- (void)printName:(NSString *)name andDescription:(NSString *)description
{
    if (name == nil) name = @"abc";
    if (description == nil) description = @"123";
    NSLog(@"%@%@", name, description);
}