【发布时间】:2014-05-29 10:48:46
【问题描述】:
if (stash != 0) {
for (i=1; i<=6; i++) {
a[1][i]=a[1][i]/stash;
}
}
else
{
NSLog (@"Matrix is Not Invertible");
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Matrix is not invertible!" delegate:nil cancelButtonTitle:@"Review Input" otherButtonTitles:nil, nil];
[alert show];
}
如果变量“stash”为零,我想停止程序,但我不能使用break,因为它不在循环中,我想使用return,但它说void不应该返回任何值......我应该怎么做才能让它工作?感谢您的所有帮助....
【问题讨论】:
-
您能否添加更多上下文。当您说“停止程序”时,您是指应用程序还是只是 for 循环?
-
请显示完整的方法。
标签: objective-c xcode5 ios7.1