Note that there are some explanatory texts on larger screens.

plurals
  1. POParsing XML causes Error
    primarykey
    data
    text
    <p>Sorry for my bad English. I'm from Germany and have some problems with parsing my xml file. I use the latest version of the iOS SDK, including Xcode.</p> <p>Parsing my xml file causes a well known error, called "Requesting for member 'Slices' in something not a structure or union"</p> <p>Seems that I have forgotten something, initializing my Delgegate Class ? Would be great if someone could help me through. It's the only error I Get... narrf..</p> <p>Here is some of the code, relevant for this problem:</p> <p>My XMLParser .h File</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @class XMLAppDelegate, Slice; @interface XMLParser : NSObject &lt;NSXMLParserDelegate&gt;{ NSMutableString *currentElementValue; XMLAppDelegate *appDelegate; Slice *aSlice; } - (XMLParser *) initXMLParser; @end </code></pre> <p>And here some parts of the .m File which shows the error:</p> <pre><code>#import "XMLParser.h" #import "XMLAppDelegate.h" #import "Slice.h" @implementation XMLParser - (XMLParser *) initXMLParser { [super init]; appDelegate = (XMLAppDelegate *)[[UIApplication sharedApplication] delegate]; return self; } - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict { if([elementName isEqualToString:@"Channel"]) { //Initialize the array. appDelegate.slices = [[NSMutableArray alloc] init]; } else if([elementName isEqualToString:@"Slice"]) { //Initialize the slice. aSlice = [[Slice alloc] init]; //Extract the attribute here. aSlice.sliceID = [[attributeDict objectForKey:@"id"] integerValue]; NSLog(@"Reading id value :%i", aSlice.sliceID); } NSLog(@"Processing Element: %@", elementName); } </code></pre> <p>The error shows up after I try to use the slices array of my delegate.</p> <p>Would be great if someone knows what to do, this little thing makes me sick. ^^</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload