ios - Getting a Parse Error Expecting a Type -
i using next code create static method homecoming dashboardmainmenuviewcontroller. in interface .h file error saying expecting type.
+(dashboardmainmenuviewcontroller *) dashboardmainmenucontroller; +(dashboardmainmenuviewcontroller *) dashboardmainmenucontroller { uisplitviewcontroller *splitviewcontroller = (uisplitviewcontroller *) [[[self appdelegate] window] rootviewcontroller]; nsarray *navigationcontrollers = [splitviewcontroller viewcontrollers]; nsarray *viewcontrollers = [[navigationcontrollers objectatindex:0] viewcontrollers]; homecoming (dashboardmainmenuviewcontroller *) [viewcontrollers objectatindex:0]; }
either #import "dashboardmainmenuviewcontroller.h"
or declare forwards reference @class dashboardmainmenuviewcontroller
. compiler aware of types defined in imported headers or forward-declared
ios objective-c
No comments:
Post a Comment