Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-16-2010, 12:02 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2010
Location: Texas
Posts: 40
ronbowalker is on a distinguished road
Default XML Parse Method

I am successfully parsing a xml file from my server into my core data model. But I have it set up in the appDelegate and it autoprocesses when the app is opened. But I would like to move this process to a iSyncViewController that has an IBAction button on it.

Here is my call for help area:
I do not know how to reference this process from the iSyncViewController to the appDelegate. (if it is even done that way!)
Or if it should be all on my iSyncViewController .m and .h files, what is the process of getting this done properly?

I really do appreciates any feedback you can give me.

I can zip or put info on this blog as you need me to. Just request it and it will be done. Where do you want me to start?

Delegate Files....

Last edited by ronbowalker; 08-16-2010 at 12:29 PM.
ronbowalker is offline   Reply With Quote
Old 08-16-2010, 01:14 PM   #2 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 196
phillipie99 is on a distinguished road
Default

Quote:
Originally Posted by ronbowalker View Post
I am successfully parsing a xml file from my server into my core data model. But I have it set up in the appDelegate and it autoprocesses when the app is opened. But I would like to move this process to a iSyncViewController that has an IBAction button on it.

Here is my call for help area:
I do not know how to reference this process from the iSyncViewController to the appDelegate. (if it is even done that way!)
Or if it should be all on my iSyncViewController .m and .h files, what is the process of getting this done properly?

I really do appreciates any feedback you can give me.

I can zip or put info on this blog as you need me to. Just request it and it will be done. Where do you want me to start?

Delegate Files....
Maybe take a look at this tut xml parsing iphone tutorial
phillipie99 is offline   Reply With Quote
Old 08-16-2010, 03:54 PM   #3 (permalink)
Code before baby wakes up
 
RobotWoods's Avatar
 
Join Date: Sep 2009
Posts: 189
RobotWoods is on a distinguished road
Default

do you mean that you want to re-parse it upon clicking a button?

In that tutorial is the section:
Code:
//Start parsing the XML file.
BOOL success = [xmlParser parse];

if(success)
NSLog(@"No Errors");
else
NSLog(@"Error Error Error!!!");
so I believe you just need to have that be your button code, after editing it slightly to point to the right place:
Code:
BOOL success = [appDelegate.xmlParser parse];
(after defining appDelegate for your particular app)
RobotWoods is offline   Reply With Quote
Old 08-16-2010, 04:35 PM   #4 (permalink)
Registered Member
 
Join Date: Jul 2010
Location: Texas
Posts: 40
ronbowalker is on a distinguished road
Default

Thanks for the help...I will see what I can get working. Meanwhile, my xml parsing to core data processes correctly, but will not fetch. It crashes when I try to. It says that the Entity could not be found. Anyone have a good sequence for xml parsing to core data? I think mine might be too lame.

if ([elementName isEqualToString:@"employee"])
{
Employee *c = (Employee *)[NSEntityDescription insertNewObjectForEntityForName:@"Employee" inManagedObjectContext:managedObjectContext];

[c setName:[attributeDict objectForKey:@"name"]];
[c setEmail:[attributeDict objectForKey:@"email"]];
[c setPhone:[attributeDict objectForKey:@"phone"]];
[c setMobile:[attributeDict objectForKey:@"mobile"]];
}
ronbowalker is offline   Reply With Quote
Reply

Bookmarks

Tags
delegate methods, xml parsing

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 358
4 members and 354 guests
givensur, linkmx, Newbie123, PlutoPrime
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,894
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:48 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0