Quick question about testing for XML attribute nil="true"

37 views
Skip to first unread message

Jim

unread,
Apr 19, 2011, 1:52:21 PM4/19/11
to ObjectiveResource
Hi all -

I'm new to working with XML and Rails, so forgive me if this is a
simple question.

In my app, I pass the iPhone's UDID as a string to Rails. Rails does a
query and finds the user that matches the UDID and sends it back to
the iPhone, which creates a User object based on the response.

This works great, except when I have a new user. It seemed easiest to
have Rails create a new user and pass it back to the iPhone, then just
test the user's name field for nil to see if it was a new user.

However, the XML that Rails returns has the name field as <name
nil="true"></name> which does not evaluate as nil in Objective C. Is
there a way I can test for that attribute, or have Rails not pass it?
Or perhaps have Obj C replace all XML fields with the nil="true"
attribute to nil?

Thanks!

Emmanuel Bellity

unread,
Mar 1, 2013, 7:21:06 PM3/1/13
to objectiv...@googlegroups.com
Hi, I know it's an old post but I have a similar issue with nil=true in the xml passed to iPhone and sometimes resulting in a bug. Did you find a way to not have nil=true in the xml response or delete it in obj C ?

Thanks,
Emmanuel
Reply all
Reply to author
Forward
0 new messages