-1

Hello Anyone please tell me how can change the loading class in xcode like index.html to login.html in ios. I am new in ios so please help me.

dogsgod
  • 6,267
  • 6
  • 25
  • 53
Naresh
  • 39
  • 2
  • 10

3 Answers3

9

the proper way of doing this, and without code changes is changing this line on the config.xml from

<content src="index.html"/>

to

<content src="login.html"/>
jcesarmobile
  • 51,328
  • 11
  • 132
  • 176
3

The simplest way I did is, xxxViewController: CDVViewController<...>

then you can write on 'init' or 'viewDidLoad'

- (id)init{
    self = [super init];
    if(self){
        self.wwwFolderName = @"dist/view";
        self.startPage = @"test.html";
    }
    return self;
}

or

-(void) viewDidLoad{
    self.wwwFolderName = @"dist/view";
    self.startPage = @"test.html";
    [super viewDidLoad];
}

so,that is all.

liubiqu
  • 75
  • 2
0

The following code will load an HTML file named index.html in your project folder:

[WebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]isDirectory:NO]]];
dgk
  • 879
  • 9
  • 15
  • Thanks.. for give quick answer but I don't know where i put this code.. please explain this... – Naresh Dec 08 '14 at 11:22
  • Please read out this post it will help you a lot: http://stackoverflow.com/questions/6420925/load-resources-from-relative-path-using-local-html-in-uiwebview – dgk Dec 08 '14 at 11:24
  • @dgk: The question was about phonegap, not native development in objective-c – dogsgod Dec 08 '14 at 11:50
  • @NareshSaini: 10 seconds of research did provide the correct answer here: http://stackoverflow.com/questions/16730695/how-to-set-the-initial-page-url-in-android-phonegap-based-application – dogsgod Dec 08 '14 at 11:54