以下代码返回:
docController.uti = @"com.yourapp.package";
为什么不抛出异常?
TypeError: cannot concatenate 'str' and 'int' objects
答案 0 :(得分:2)
你可以像这样捕捉异常:
try:
print "test" + 1
except ValueError:
print "You can't concatenate that different object types silly"
except TypeError:
print "TypeError and the words you want to say"