Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Create and Destroy WebView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Create and Destroy WebView




On Aug 11, 2007, at 9:31 AM, Paul FitzGerald wrote:

I'm wondering about the correct way to build a WebView on-the-fly and how to destroy it when I'm done. I'm currently getting random crashes (only thing in the stack crawl is "longjump" or something like that).

Anyway, This is what I'm doing to create/destroy my WebView. There is not much in the documentation about how to do this.

Create...
NSRect myRect = [[myWindow contentView] frame];
myWebKitView = [[WebView alloc] initWithFrame:myRect frameName:nil groupName:nil];
[[myWindow contentView] addSubview:myWebKitView];
[myWindow setLevel:NSFloatingWindowLevel];
[myWindow makeKeyAndOrderFront:nil];


Destroy...
		[myWebKitView removeFromSuperview];
		myWebKitView = nil;
		[myWindow orderOut:self];	// Hide Window.


Unless you're using garbage collection, you need to release the view because you've alloc'd it:

		[myWebKitView removeFromSuperview];
		[myWebKitView release];

--
Rob Keniger


_______________________________________________ Do not post admin requests to the list. They will be ignored. Webkitsdk-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Create and Destroy WebView (From: Paul FitzGerald <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.