NSString – Getting a Substring

One thing I found different in Objective C was how getting a substring was done. If you have seen my previous posts you may have noticed this method.  I use it to grab a particular element value from XML without parsing the whole doc.  It also serves as a good example of how to get a substring from a NSString.

Read the rest of this entry »

NSXMLParser used to Decode XML

One problem I found was that when I was receiving encoded XML from a webservice I would need to decode it so I could use it.  What I ended up doing was just running it through the NSXMLParser and building it into a new XML doc that I will dispose of when finished. It’s pretty simple and saves me a nuch of time.  This will also decode any form of tagged language so XHTML will go as well.

Read the rest of this entry »

How to call Soap Webservices Synchronously

As I browsed the internet I found a few examples of how to call soap webservices on the iphone. The main example I found actually generated 3 calls – 2 asynchronous and 1 synchronous calls. I then decided a much more concise static method was needed to do the job and while the example I had found works, it isn’t something you would ever want to use in your own application. With that said, here is my solution.

Also to note, If you create a NSURLConnection and don’t use the static sendSynchronousRequest method, you are creating an asynchronous call and should be aware of that.

Read the rest of this entry »