tags:

views:

696

answers:

1

Hello, I am trying to develop an export aperture plugin, I have designed some views/windows and everything runs smoothly, but trying to now add a webView on one of the window, and cannot make it to display the linked url (hard typed in the code).

Is webView not supported because I'm running it within aperture? anyone having problem with this?

I'm not getting any errors, and used the webView object in the simplest way as possible.

The code to load the web page on webView:

[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
A: 

Make sure you hooked up the outlet to the web view in IB (assuming that the web view is in a nib). Many, many Cocoa programmers forget that.

If it's not in a nib, please edit your question to include the code you used to create it.

Peter Hosey
I hooked the webView to the file's owner, then I tried to hooked it to the Window instead, then to the View (which is in the window I added the webView). None makes any difference.
marcme: What? I'm assuming that the outlet variable is *in* the File's Owner; why would you connect it to itself? Moreover, if you have an outlet named `webView`, and its type is `WebView *`, then you should connect it to a web view—not to a window or any other kind of view.
Peter Hosey
The webView variable is declared in the file's owner, and is of type WebView *. The only elements I ever 'hooked' to the file's owner were actions (which worked fine), so I'm not really confident with how the webView should be connected. So it might be the issue. Just can't see what's wrong
You need to connect the outlet to the web view. Until you do that, all your messages to the web view are messages to either a dark hole (`nil`) or the wrong thing (anything that isn't a web view). See the IB user guide: http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/IB_UserGuide/
Peter Hosey
For sure my webView outlet is connected to the WebView object which I have added to using the Interface Builder.
I may see something wrong with what I have done. I have coded the declaration of the webView outlet within my interface. I can see that if I create a new outlet using the IB I get it placed within the nib package... a bit lost here :S
Declaring outlets in the source code is fine. There's nothing wrong with that. Just make sure you declare it with the word `IBOutlet` in front of it so that IB knows about the outlet.
Peter Hosey
Really there is something weird going on. I doubt that WebView does work when integrated in an Aperture export plugin.
I have just created a stand-alone app, adding a webView in the same way and it loads perfectly. Only trying to add it in the aperture plugin fails.
Visibly not the only one having this issue:http://lists.apple.com/archives/Aperture-dev/2009/May/msg00004.htmlNot obvious to find the alternative package though