ios - Open link starting with http but not www -



ios - Open link starting with http but not www -

i want open link starting www not open. code working http. please help > newer in ios.i shall highly obliged.

- (bool)webview:(uiwebview *)webview shouldstartloadwithrequest:(nsurlrequest *)request navigationtype:(uiwebviewnavigationtype)navigationtype { if (navigationtype == uiwebviewnavigationtypelinkclicked) { nslog("user tapped link."); } if ([request.url.absolutestring rangeofstring:@"iosscrollposition:"].location != nsnotfound) { nsstring *positionstring=[[[request url]absolutestring] stringbyreplacingoccurrencesofstring:@"iosscrollposition:" withstring:@""]; nsarray *positionarray=[nsarray arraywitharray:[positionstring componentsseparatedbystring:@","]]; nsinteger x=[[positionarray objectatindex:0] integervalue]; nsinteger y=[[positionarray objectatindex:1] integervalue]; if (initialyposition != y || y==0) { if (initialyposition!=0 ||x==0) { [myscrollview setcontentoffset:cgpointmake(myscrollview.contentoffset.x,myscrollview.contentoffset.y+20) animated:no]; } initialyposition=y; } if (x>320) { [webviewscrollview setcontentoffset:cgpointmake(x-300,webviewscrollview.contentoffset.y) animated:no]; } else if(x<320) { [webviewscrollview setcontentoffset:cgpointmake(0,webviewscrollview.contentoffset.y) animated:no]; } homecoming no; } else if([request.url.absolutestring rangeofstring:@"http://"].location == nsnotfound) { homecoming yes; } else { homecoming no; } }

nsurl *url=[nsurl urlwithstring:@"http://"]; [self.mywebview loadhtmlstring:tempstring baseurl:url];

ios uiwebview

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -