Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3321172
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:01:51+00:00 2026-05-17T23:01:51+00:00

Sorry for my bad English. I’m from Germany and have some problems with parsing

  • 0

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.

Parsing my xml file causes a well known error, called “Requesting for member ‘Slices’ in something not a structure or union”

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..

Here is some of the code, relevant for this problem:

My XMLParser .h File

#import <UIKit/UIKit.h>

@class XMLAppDelegate, Slice;

@interface XMLParser : NSObject <NSXMLParserDelegate>{

    NSMutableString *currentElementValue;

    XMLAppDelegate *appDelegate;
    Slice *aSlice; 
}

- (XMLParser *) initXMLParser;

@end

And here some parts of the .m File which shows the error:

#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);
}

The error shows up after I try to use the slices array of my delegate.

Would be great if someone knows what to do,
this little thing makes me sick. ^^

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:01:52+00:00Added an answer on May 17, 2026 at 11:01 pm

    Parsing the XML file didn’t do anything, because you haven’t gotten that far. Your program will only parse XML when it runs; your code has not run yet, because it does not compile.

    The error is in compilation (which is why you’re seeing it in Build Results), and is a syntax error: You have tried to use a name that the compiler does not recognize as valid for the place where you used it.

    Specifically:

            appDelegate.slices = [[NSMutableArray alloc] init];
    

    The compiler doesn’t know that appDelegate has a slices property; as such, it falls back on its C roots and complains that you’re trying to do a structure access to something that isn’t a structure. You show in your code that you imported the header for the AppDelegate class, so the problem must be that you didn’t declare the slices property in that class’s @interface.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry for bad english and bad title! I have the table post id title
Sorry for my bad English. Just like what I asked. I have this class
First, sorry for my bad english, I'm French. Here the problem : I have
First. Sorry for bad english. I want to make some common transformation of Map
first, i am sorry for bad English. I need modify integer number from 10000
Sorry my bad English. I am trying to start Apache HTTPD server from Java
I`m from Russia, so sorry for bad English. I want to load template in
At first sorry for bad english, Im deafinitely not specialized into math-english. I have
Sorry for bad English :( Suppose i can preliminary organize recipes and ingredients data
At first sorry my bad English. I want define routing for this url: For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.