selecting window to open on CMD+N
when I press CMD+N a window called "Untitled" opens containing the text "Your document contents here"
Im following this tutorial: http://macdevcenter.com/pub/a/mac/2004/05/28/webkit.html?page=2
but the problem is that Im using XCode 3.2 and that only one outlet shows up on the "File's Owner" so I connected everything to "My Document" that did have the proper outlets.
thats the only thing I've done different, the browser is further fully functional, but the window thing really bugs me, and it said it should work.
Wolf
That's a rather old tutorial and both XCode and Interface Builder have moved along in 5+ years since it was written. I'll try to find time tomorrow evening to write a new version of the Tutorial (for XCode 3.2.1) and put it on my website for you.
If you'd like me to demo and explain this, you may VNC to my computer and we can talk on Skype (or Phone). If you'd like to take up my offer, email me at robin@clanmills.com . I'm in California.
It's quicker and less work for me if you can VNC and Skype. Writing an on-line tutorial takes quite a lot of effort. And of course you can follow along beside me on your computer if we use VNC.
thanks for the quick response, but I rather you wrote the tutorial.
that way, someone else would be able to view it too.
also, Im Dutch, that means one of us would be having to do really crazy bed times for a live connection (different time zones).
http://clanmills.com/files/BYOB.pdf
If you'd like to comment about this, please email me directly robin@clanmills.com and I'll add screenshots or additional text. I think you'll understand that it's easier to demonstrate than to document. So I welcome your criticism - however I would like you to provide suggestions in private and I'll update the tutorial.
I am available on Saturday about 06:00PST = 15:00CET if that's convenient for you.
it was a little bit hard, but I figured the tutorial out.
one question, how do I make the text say http:// when the user doesn't enter that?
I remember something about that in windows programming, but this one is kinda hard to figure out if you don't know what you're doing, because no programming is used to make it work.
Here's a 'no thrills' method of doing it. It simply inspects the address.
- (IBAction) go : (id) sender
{
NSString* address = [ addressField stringValue] ;
NSLog(@"%@",address) ;
// sniff for http:// and if missing, update the UI and the address
NSString* http = @"http://" ;
UInt http_l = [http length];
bool bHttp = [address length] > http_l ;
if ( bHttp ) bHttp = [[address substringToIndex:http_l]
caseInsensitiveCompare: http] == NSOrderedSame;
if (!bHttp ) {
// update the UI
NSString* newAddress = [[NSString alloc]initWithFormat:@"%@%@",http,address] ;
[addressField setStringValue:newAddress];
[newAddress release] ;
// reread address from the control
address = [ addressField stringValue] ;
NSLog(@"rewritten as %@",address) ;
}
// display the address in the webview
[[webView mainFrame] loadRequest:
[NSURLRequest requestWithURL:[NSURL URLWithString: address ]
]];
}