views:

31

answers:

2

Hi all !

I have a plist in my document folder of the app with one string, an int value. An another plist is on my server with also a string, an int value.

How can i compare the two int value and then do something if one is bigger than the other thanks to all

A: 

You need to download the contents of the remote plist and compare it to the local one. Then you can 'do something' if it meets the criteria (e.g. if it's bigger).

Use NSURLConnection to download the data.

You can't compare without downloading.

Rengers
Sure you can; you can compare on the server-side.
Dave DeLong
Yes, but you still need to download some response data. Even if it's an HTTP response. But ok, I'm kinda taking this to literally. ^^
Rengers
+3  A: 

How about sending along that int value as part of your download url (in a query parameter), and then only download the file if the number is different? Otherwise return a HTTP 304 (content unmodified) response. This is pretty simple to do in PHP at least...

Dave DeLong