Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > How could I...

How could I...
Thread Tools
alainmeyer1
Junior Member
Join Date: Apr 2007
Status: Offline
Reply With Quote
Apr 29, 2007, 11:30 AM
 
MacBrowse

Well I have JUST started coding and this is my first ever app.
Well I want to do the following things and I am wondering if people could help me with ANY:

1. You have to type http:// for the page to load, is there a way for it to add itself if the user didn't?
2. Add bookmarks
3. Add history
4. Make a loading bar above the page.
5. Tabs at one point or another

Well I have tried HARD for number 4, I have created a link from the WebView object to the loading bar with output: frameLoadDelegate, but that doesn't seem to work.

If anyone can help me with any of these I would appreciate it a LOT.

Thanks

PS. If I need to provide the .xproj I will
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Apr 29, 2007, 05:38 PM
 
NSProgressIndicator doesn't implement the WebFrameLoadDelegate protocol. Your delegate should be a controller object that updates the loading bar.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
registered_user
Dedicated MacNNer
Join Date: Nov 2001
Location: Are Eye
Status: Offline
Reply With Quote
Apr 29, 2007, 09:04 PM
 
This thread's title is awesome.
     
Brass
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Apr 30, 2007, 12:09 AM
 
You really should become familiar with the developer documentation. Some of the answers are quite simple once you get to know the classes by looking through the documentation.

Eg, for prepending 'http://' if required...

Check the documentation for the NSString class (and NSMutableString). In particuluar, you might be interested in the methods -[NSString rangeOfString:] and -[NSMutableString replaceCharactersInRange:withString:] (or -[NSString appendString:]).

Two of these three methods are almost all that's required to solve your .1. point.

After a very superficial look, the app's interface looks neat. Should probably not distribute as a zipped .dmg. A .dmg is compressed anyhow so this just complicates the user's access to it (and you can control the degree of compression too).

Agree with the comment about the thread title.
     
alainmeyer1  (op)
Junior Member
Join Date: Apr 2007
Status: Offline
Reply With Quote
Apr 30, 2007, 11:03 AM
 
Hey, thanks for the replies.

Sorry, as I said I'm still learning so I didn't think of going to the documentation.

And what's so good about the thread title? I don't like sarcasm >:3
     
Brass
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Apr 30, 2007, 06:51 PM
 
Originally Posted by alainmeyer1 View Post
And what's so good about the thread title? I don't like sarcasm >:3
Thread titles should give some idea of what the thread is about. I think it may even be in the forum rules. It should be descriptive enough so that people can decide if the thread is likely to interest them, or if they can help, without reading having to click and load the entire thread.

eg, "Questions about my first ever application", or, "Need help building a web browser", or "Basic NSString use and other queries".
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Apr 30, 2007, 08:21 PM
 
I like how it sounds like he's aghast at himself. "How could I…? I'm such a heartless monster!"
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
alainmeyer1  (op)
Junior Member
Join Date: Apr 2007
Status: Offline
Reply With Quote
May 1, 2007, 11:10 AM
 
Ohhh okay, next time I'll make a better title

Well this is my code to for the URL connection:

- (IBAction)connectURLid)sender{
[urlString setStringValue:[sender stringValue]];
[[webView mainFrame] loadRequest:
[NSURLRequest requestWithURL:
[NSURL URLWithString:
[sender stringValue]]]];
}

Is there a way for me to change that so that the app checks if there is a ":" in the beginning and if there isn't adds http://?

Thanks
     
Catfish_Man
Mac Elite
Join Date: Aug 2001
Status: Offline
Reply With Quote
May 1, 2007, 12:30 PM
 
Yes. Just check [sender stringValue] for an http:// prefix, and add it if it's not there. See the NSString documentation for how to do this.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 12:40 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,