0

I am creating a application which have webviews as well as native screens.I have created nav controller for moving from 1 native screen to another.For moving from 1 webview to another i am using webview's goBack() method.

I want to know how one can detect whether a particular view is a webview or native screen.because then the logic will be written in the nav controller for navigating from native to webview and vice versa.Have tried shouldstartloadwithRequest method of webview delegate and tried finding out Navigationtype also but no luck.

if anybody have done such a thing please suggest the methods to do it.

Thanks

vikingosegundo
  • 52,040
  • 14
  • 137
  • 178
dead_soldier
  • 429
  • 1
  • 5
  • 18
  • Give a try with a Tag property !!! If that can solve your problem ... – Ajay Sharma Jan 27 '12 at 04:34
  • How about this solution [http://stackoverflow.com/questions/1144629/in-objective-c-how-do-i-test-the-object-type][1] [1]: http://stackoverflow.com/questions/1144629/in-objective-c-how-do-i-test-the-object-type – Paxic Jan 27 '12 at 04:37
  • I hope one day Apple will kill the tag property. It leads to poor code and and really badly implementations of different pattern. – vikingosegundo Jan 27 '12 at 04:38
  • @ajay how to do with tag property – dead_soldier Jan 27 '12 at 04:53

1 Answers1

1

You can check for class membership like this:

if ([view isKindOfClass:[UIWebView class]]) {
    /* do something */
}
esqew
  • 42,425
  • 27
  • 92
  • 132