i got a prob when i tried to set webview property on uiviewcontroller.
here the code:
UIWebView:
@interface mainView : UIWebView {
int currentPage;
}
@property int currentPage;
and i synthesize on the implementation
UIViewController
(void)loadView {
webview = [[mainView alloc]init];
webview.currentPage = 2; // error -> Request for member "currentPage' in something not a structure or union
self.view=webview;
[webview release];
}
why i am unable to set the currentPage property?
Anyone know the solution so tat i can set currentPage on UIViewController?
Thanks.
Is
webviewan instance ofmainView(incidentally, class names should begin with a capital letter, so it should beMainView), or is it an instance ofUIWebView. It looks like you have forgotten to declarewebviewas the correct class type, as the compiler isn’t recognising that it has a property calledcurrentPage.