ok, i chalked up some code but still having problems
in my app delegate i have ` [self performSelectorInBackground:@selector(loadAppContent) withObject:nil];
return YES;
}
-(void)loadAppContent
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// Do work . . .
// dismiss the holding view
Newcastle *newcastle = [[Newcastle alloc]init];
[newcastle loadNews];`
and then in my view controller i have
- (void)loadNews;{
// instantiate an array to hold the stories objects
stories = [[NSMutableArray alloc] init];
// Load and parse the stories.xml file
tbxml = [[TBXML tbxmlWithXMLFile:@"scores.xml"] retain];
// Obtain root element
TBXMLElement * root = tbxml.rootXMLElement;
// if root element is valid
if (root) {
// search for the first story element within the root element's children
TBXMLElement *story = [TBXML childElementNamed:@"story" parentElement:root];
while (story != nil) {
//alloc and init story
NewcastleStories *aStory = [[NewcastleStories alloc] init];
//get the story headline and standfirst
TBXMLElement *title = [TBXML childElementNamed:@"title" parentElement:story];
aStory.headline = [TBXML textForElement:title];
NSLog(@"headline : %@", aStory.headline);
TBXMLElement *intro = [TBXML childElementNamed:@"intro" parentElement:story];
aStory.standfirst = [TBXML textForElement:intro];
//get image url
TBXMLElement *pict = [TBXML childElementNamed:@"image" parentElement:story];
aStory.picture = [TBXML textForElement:pict];
// find the next sibling element named story
story = [TBXML nextSiblingNamed:@"story" searchFromElement:story];
//add to array an release
[stories addObject:aStory];
[aStory release];
}
}
// release resources
[tbxml release];
[self dataLoaded];
}
-(void) dataLoaded{
[self.newsStories reloadData];
}
still does not work , can anyone point out what i am doing wrong?