⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 try-catch-1.m

📁 Mac OS X 10.4.9 for x86 Source Code gcc 实现源代码
💻 M
字号:
/* Test if the compiler accepts @throw / @try..@catch..@finally syntax.  *//* Developed by Ziemowit Laski <zlaski@apple.com>.  *//* { dg-options "-fobjc-exceptions" } *//* { dg-do compile } */#include <objc/Object.h>#include <stdio.h>#include <setjmp.h>@interface Frob: Object@end@implementation Frob: Object@endstatic int exc_control = 0;int proc() {  if(exc_control) {    printf ("Throwing (%d)... ", exc_control);    @throw [Frob new];  }  return 1;}int foo(){        @try {                return proc();        }        @catch (Frob* ex) {		if(exc_control > 1) {		  printf("Rethrowing (%d)... ", exc_control);		  @throw;		}		return 0;        }	@finally {		printf("In @finally block (%d)... ", exc_control);	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -