i have an online xml file filled with items.
At startup i check my internet connection, if so, i parse the xml and compare the item objects to those in my sqlite database. One of the item values is 'lastupdated', whichs is a php generated string.
if the lastupdated value from the xml item is different from the value of the one in the database, the item needs to be updated into the database.
I seem to have parsing errors: as the lastupdated value in my database has 10 characters, and the one in my xml file seems to have 11.. When I output both i get the following:
2010-03-26 15:15:07.771 bbc_v1[97647:207] 1269429166 2010-03-26 15:15:07.771 bbc_v1[97647:207] 1269429166 2010-03-26 15:15:07.771 bbc_v1[97647:207] lenght xml item value: 11 2010-03-26 15:15:07.771 bbc_v1[97647:207] length db value: 10
it seems i'm having parsing problems with whitespace and enter/return stuff? How should I clean the xml value?
What about running strip or trim on the string. This normally eliminates whitespaces.
Try the
-stringByTrimmingCharactersInSet
function: