现在的位置: 首页 > 综合 > 正文

‘goto into protected scope’ error

2018年05月17日 ⁄ 综合 ⁄ 共 295字 ⁄ 字号 评论关闭

原文链接:http://blog.kmaku.com/?p=20

When you use goto keyword in your code. You must be sure that any variable should not be declared below goto keyword and above the label it points within its scope.
example

goto cleanup;
NSString *blar = nil;
cleanup:
NSLog("cleaned up");

You should move blar declaration above the goto keyword. Then it will work.

抱歉!评论已关闭.