questions
questions
- Subject: questions
- From: email@hidden (Farl)
- Date: Mon, 13 Aug 2001 11:30:23 -0700
In my ongoing newbie questioning, here are my next few:
1.
With a NSURL, (i think) i can manage to check the format of an NSString to look for the http:// at the beginning, and if it is not there, add it in. Trivial once I found the right commands. My question comes, that when i use get the contents of that URL (which is again easy with the right command), I also need to get the status code (ie. ok=200, not found=404, forbidden=403). I know what each number code stands for, but i just do not know if there is a command that returns this. Of course, it is implicit that if getContentsOfURL returns a non-nil, it is a code-200. I am just wondering how to track all the nil returns and WHY/WHAT CODE returns with failures.
2.
I want to build in a set of hash tables for key values. Namely the hash set of error codes to error names (as in above). Now I think the way to do this is using NSMutableDictionary. However, in my lack of programming experience, and the absolute stupidity of how Apple sets out its developer docs, it lists the commands, but simply fails to give some simple examples of how to actually use it in a real way. Any simple example code of this would be great.
3.
I want to load the set of hash tables (see above) when the program loads. Normally in c++ i would just stick all of it in a procedure that ran first under int main();. However, I cannot see where to do this in osX's cocoa layout. I need these hash tables to load up when the program does, not everytime the "go" button is pressed in my program.
4.
And lastly, with NSString, is there a limit to how long a NSString can be?
thanks for any info!
searle
email@hidden
www.sketchwork.com