我想我快看不见了,因为我找不出这段代码中的语法错误在哪里:
if( cell == nil ) {
titledCell = [ [ [ TitledCell alloc ] initWithFrame:CGRectZero
reuseIdentifier:CellIdentifier ] autorelease
];
switch( cellNumber ) {
case 1:
NSString *viewDataKey = @"Name";
etc...当我试图编译它时,我得到了一个错误:语法错误在最后一行的'*‘标记之前。
对于这样一个基本的问题,我很抱歉,但是我错过了什么?
发布于 2009-07-12 04:42:23
在C中,你只能在任何非declare语句之前,在代码块的开头声明变量。
{
/* you can declare variables here */
/* block statements */
/* You can't declare variables here */
}在C++中,您可以在需要的任何地方声明变量。
https://stackoverflow.com/questions/1115304
复制相似问题