Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
uiwebview problem
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Nethfel" data-source="post: 1296285" data-attributes="member: 89124"><p>I see a couple of things.</p><p></p><p>First note - you're using sizing that is wrong.</p><p></p><p>CGRect frame= [[UIScreen mainScreen] applicationFrame];</p><p>UIWebView *webview1 = [[UIWebView alloc] initWithFrame:frame];</p><p></p><p>You shouldn't be requesting the frame of the UIScreen for setting the webview frame, you should be requesting the bounds of the view that you're adding the webview into (the detail controllers view). The frame of the screen is going to be the full size of the screen that the application window resides in rather then the size of the detail view which will be different depending on landscape or portrait orientation.</p><p></p><p>And why are you doing this:</p><p></p><p>[self performSelector<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite4" alt=":mad:" title="Mad :mad:" loading="lazy" data-shortname=":mad:" />selector(startWebViewLoad) withObject:nil afterDelay:0]; ?</p><p></p><p>you should just do:</p><p></p><p>[self startWebViewLoad];</p><p></p><p>All you're doing is adding in additional method calls that aren't necessary in this case.</p><p></p><p>You're also using the activity indicator in a funky way - it should be spinning during the time of load, which you should activate through the UIWebViewDelegate methods which you haven't implemented (but need to). </p><p></p><p>Your code is odd though. You're creating a detailViewController in the subtable class, but no where do I see where you're setting the detail view controller of the splitviewcontroller to be that controller you allocated. Just because it may have the same name and be of the same class of another instance doesn't mean you have access to instance A through instance B of a given class.</p><p></p><p>It looks to me like you don't quite understand how to communicate between the master and the detail view of the split view controller, and in that you are never really telling the ACTUAL detail view controller to load and display the content. So my guess based upon the code you have posted is because you aren't actually communicating with the actual instance of the detail view that is really on the screen but rather the one you alloc'd in the subtable.m file which is different from the one that is in the split view detail panel.</p></blockquote><p></p>
[QUOTE="Nethfel, post: 1296285, member: 89124"] I see a couple of things. First note - you're using sizing that is wrong. CGRect frame= [[UIScreen mainScreen] applicationFrame]; UIWebView *webview1 = [[UIWebView alloc] initWithFrame:frame]; You shouldn't be requesting the frame of the UIScreen for setting the webview frame, you should be requesting the bounds of the view that you're adding the webview into (the detail controllers view). The frame of the screen is going to be the full size of the screen that the application window resides in rather then the size of the detail view which will be different depending on landscape or portrait orientation. And why are you doing this: [self performSelector:@selector(startWebViewLoad) withObject:nil afterDelay:0]; ? you should just do: [self startWebViewLoad]; All you're doing is adding in additional method calls that aren't necessary in this case. You're also using the activity indicator in a funky way - it should be spinning during the time of load, which you should activate through the UIWebViewDelegate methods which you haven't implemented (but need to). Your code is odd though. You're creating a detailViewController in the subtable class, but no where do I see where you're setting the detail view controller of the splitviewcontroller to be that controller you allocated. Just because it may have the same name and be of the same class of another instance doesn't mean you have access to instance A through instance B of a given class. It looks to me like you don't quite understand how to communicate between the master and the detail view of the split view controller, and in that you are never really telling the ACTUAL detail view controller to load and display the content. So my guess based upon the code you have posted is because you aren't actually communicating with the actual instance of the detail view that is really on the screen but rather the one you alloc'd in the subtable.m file which is different from the one that is in the split view detail panel. [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
uiwebview problem
Top