Expected expression before 'NSArray'


由於 gcc 的 bug 在 case statement 之後的第一行不能是宣告變數之類的令命,否則產生 Expected expression before 'XXXX' 的編譯錯誤。解決的方法是在該區段以 {} 包住,就可以成功通過編譯了。

	switch (something) {
		case 0: {
			// pass gcc compile success
			NSArray *array = [[NSArray alloc] init];
			break;
		}


Comments (1)

Login

E-mail
Password

Login with Facebook

If you have a facebook account, you may also connect with your facebook account

Login with Facebook

zhim! extended

zhim! extended is your own free personalized Chinese Input Method app on your iPhone or iPad. Great for typing text when mix-up Chinese and English without bothering switch between keyboards.



支援自訂輸入法詞庫
支援自訂輸入法鍵盤
支援自訂數字鍵快選候選字
支援外接鍵盤

已測試相容輸入法:
行列
倉頡
嘸蝦米
大易
倚天26
拼音
注音

Google Ads

Tags

About the Author

He is a freelance web developer who interested in front-end development, web accessibility, web design, graphic design and web development.