我有 3 个带有整数(枚举)的数组:
static int *openEnv[] = {INGMenuItemLogon,INGMenuItemSpace,INGMenuItemAppointment,INGMenuItemInfo,INGMenuItemSettings};
static int *closedEnv[] = {INGMenuItemLogoff,INGMenuItemSpace,INGMenuItemOverview,INGMenuItemAccounts,INGMenuItemTransfer,INGMenuItemAnalyse,INGMenuItemAppointment,INGMenuItemInfo,INGMenuItemSettings};
int *currentEnv[];
如果用户点击一个按钮,我希望将currentEnv
其更改为openEnv
或closedEnv
- (void) tap
{
if( closed ) currentEnv = closedEnv;
else currentEnv = openEnv;
}
但这会产生构建错误。
openEnv
并且closedEnv
有 2 种不同的尺寸,我应该怎么做才能复制它?我该怎么做才能引用或复制到它的静态数组?