Ask a Question related to Mac Programming, Design and Development.
-
Simon Slavin #1
Cocoa: does stringWithContentsOfURL do conditional GETs ?
I'm making use of stringWithContentsOfURL in a client which does
repeated downloading of an RSS feed (don't worry -- I don't
thrash the server). It's really useful and considerably
simplifies my application. However, the person who runs the site
my application looks at has pointed out that my client should be
checking the 'Last-Modified' header.
I don't know if it is or not. Is it ? If not, how much of an
HTTP client do I have to write to do this correctly ?
If there's any doubt, I'm talking about the things discussed at
[url]http://fishbowl.pastiche.org/archives/001132.html[/url]
Simon Slavin Guest
-
Cocoa: NSComboBoxCell in NSTableColumn
Hi, my application uses a NSTableView with one NSTableColumn, which needs a combobox instead of a texfield as the data-cell. Creating a... -
Bit shifts in Cocoa
Does anyone know how to do bit shifts in Cocoa? I have declared an integer and I want to shift it one bit to the right (same as dividing by 2). ... -
Q About Cocoa & CF Prefs..
In article <no-EA814A.20172229072003@netnews.upenn.edu>, Mark Haase <no@spam.please> wrote: Not only that, if the same preference file is... -
Cocoa Filemaker
"Edward Smith" <esmith@thegoodstuff.se> wrote in message news:BB44ABA1.4676%esmith@thegoodstuff.se... I presume so. There was a statement from... -
[Cocoa] Bug with NSTableView?
> I'll check these accessor methods, as this may be the problem. It was the setCol* methods that were causing the problem. I stupidly put:... -
Tom Harrington #2
Re: Cocoa: does stringWithContentsOfURL do conditional GETs ?
In article <BB82C24B96689DBA98@10.0.1.2>,
[email]slavins@hearsay.demon.co.uk[/email]@localhost (Simon Slavin) wrote:
If you don't know if it is, then it's not. Think about it: You're> I'm making use of stringWithContentsOfURL in a client which does
> repeated downloading of an RSS feed (don't worry -- I don't
> thrash the server). It's really useful and considerably
> simplifies my application. However, the person who runs the site
> my application looks at has pointed out that my client should be
> checking the 'Last-Modified' header.
>
> I don't know if it is or not. Is it ? If not, how much of an
> HTTP client do I have to write to do this correctly ?
passing an NSURL that you want loaded into the NSString. If you didn't
tell the NSURL at some point what the last modified date is, there's no
way it can know and therefore no way it can check.
I'm not sure what the best solution is, although NSURL's
-setProperty:ForKey looks mighty tempting. However you may need to
consider using WebKit for this-- no need to write an HTTP client when
Apple has already given you Safari's guts for free, eh?
--
Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 1.4: Best cleanup yet, gets files other tools miss.
See [url]http://www.atomicbird.com/[/url]
Tom Harrington Guest
-
Doc O'Leary #3
Re: Cocoa: does stringWithContentsOfURL do conditional GETs ?
In article <BB82C24B96689DBA98@10.0.1.2>,
[email]slavins@hearsay.demon.co.uk[/email]@localhost (Simon Slavin) wrote:
No.> However, the person who runs the site
> my application looks at has pointed out that my client should be
> checking the 'Last-Modified' header.
>
> I don't know if it is or not. Is it ?
Depends on how you define "correctly". I don't know the internals of> If not, how much of an
> HTTP client do I have to write to do this correctly ?
NSURL, but you can manually check the header with something like:
NSString *remoteModString = [siteURL propertyForKey: @"Last-Modified"];
I do this for wCal, but I've never bothered to see if NSURL is smart
enough to just get the headers to check that or if it's simply part of a
full response. No mechamism for a proper, request-header-based
conditional get seems to be supported. Look at the extensive set of
other NSURL* classes or possibly Web* classes will help simplify the
task.
Doc O'Leary Guest



Reply With Quote

