Hey everyone,
I'm just starting to get the hang of obj-c, but I still have a long way to go.
I have a pretty basic understanding of the terminology, but no matter what I've read I can't seem to find the answer to this question. To illustrate it best, let me give you a hypothetical situation:
Let's say I have a remote XML file on some webserver with the following format:
In my interface, I have two text labels (one for quote, and one for author) and a button.
In my viewController header file, I've declared the UILabels for both labels, as well as two NSString's. I've also added an IBAction called changeLabel:, which is linked to my button.
What I would like to do is the following:
When the button i pressed, I would like for the remote XML file to be parsed in such a way that I end up with the info from the <body> tags in one NSString and the info from the <author> tags in the other NSString. From there, I know exactly how to change the labels - it's just getting that data from the remote XML that I can't wrap my head around.
If anyone could please offer some help, I would be very grateful. Thank you!
I'm just starting to get the hang of obj-c, but I still have a long way to go.
I have a pretty basic understanding of the terminology, but no matter what I've read I can't seem to find the answer to this question. To illustrate it best, let me give you a hypothetical situation:
Let's say I have a remote XML file on some webserver with the following format:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<quote>
<id>1</id>
<body>A penny saved is a penny earned.</body>
<author>Unknown</author>
</quote>
In my interface, I have two text labels (one for quote, and one for author) and a button.
In my viewController header file, I've declared the UILabels for both labels, as well as two NSString's. I've also added an IBAction called changeLabel:, which is linked to my button.
What I would like to do is the following:
When the button i pressed, I would like for the remote XML file to be parsed in such a way that I end up with the info from the <body> tags in one NSString and the info from the <author> tags in the other NSString. From there, I know exactly how to change the labels - it's just getting that data from the remote XML that I can't wrap my head around.
If anyone could please offer some help, I would be very grateful. Thank you!