XMLParser gibt 2errors...

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • XMLParser gibt 2errors...

    Hallo, achtung: AnfängerAlarm! ;)

    Hab n'XML-Parser basteln wollen. Das Ziel ist schliesslich ein Stundenplan darzustellen. In der Appdelegate ist:




    - (void)applicationDidFinishLaunching:(UIApplication *)application {

    NSURL *url = [[NSURL alloc]

    initWithString:@"http://parfume-outlet.com/file.xml"];

    NSXMLParser *finalParser = [[NSXMLParser alloc] initWithContentsOfURL:url];

    //initialize delegate

    FinalParser *parser = [[FinalParser alloc] initXMLParser];

    //Set delegate

    [finalParser setDelegate:parser];

    //Start Parsing

    BOOL success = [finalParser parse];
    if(success)

    NSLog(@"No Errors");

    else

    NSLog(@"Error!!!");

    //show the window

    [window addSubview:navigationController.view];

    [window makeKeyAndVisible];

    return YES;

    }


    In der Linie:

    Quellcode

    1. FinalParser *parser = [[FinalParser alloc] initXMLParser];



    Krieg ich 2 error:


    error: 'FinalParser' undeclared (first use in this function)

    error: 'parser' undeclared (first use in this function)




    Wie gesagt, bin Anfänger, danke für die Hilfe
  • funktioniert... nicht...

    Quellcode

    1. 2010-09-19 14:44:55.108 Final[2857:207] -[FinalParser initXMLParser]: unrecognized selector sent to instance 0x5f45c00
    2. 2010-09-19 14:44:55.251 Final[2857:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FinalParser initXMLParser]: unrecognized selector sent to instance 0x5f45c00'
    3. *** Call stack at first throw:
    4. (
    5. 0 CoreFoundation 0x02487b99 __exceptionPreprocess + 185
    6. 1 libobjc.A.dylib 0x025d740e objc_exception_throw + 47
    7. 2 CoreFoundation 0x024896ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    8. 3 CoreFoundation 0x023f92b6 ___forwarding___ + 966
    9. 4 CoreFoundation 0x023f8e72 _CF_forwarding_prep_0 + 50
    10. 5 Final 0x000025e4 -[FinalAppDelegate applicationDidFinishLaunching:] + 193
    11. 6 UIKit 0x002b9f80 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1252
    12. 7 UIKit 0x002bc3b0 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 346
    13. 8 UIKit 0x002c63ec -[UIApplication handleEvent:withNewEvent:] + 1958
    14. 9 UIKit 0x002beb3c -[UIApplication sendEvent:] + 71
    15. 10 UIKit 0x002c39bf _UIApplicationHandleEvent + 7672
    16. 11 GraphicsServices 0x02d67822 PurpleEventCallback + 1550
    17. 12 CoreFoundation 0x02468ff4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
    18. 13 CoreFoundation 0x023c9807 __CFRunLoopDoSource1 + 215
    19. 14 CoreFoundation 0x023c6a93 __CFRunLoopRun + 979
    20. 15 CoreFoundation 0x023c6350 CFRunLoopRunSpecific + 208
    21. 16 CoreFoundation 0x023c6271 CFRunLoopRunInMode + 97
    22. 17 UIKit 0x002bbc6d -[UIApplication _run] + 625
    23. 18 UIKit 0x002c7af2 UIApplicationMain + 1160
    24. 19 Final 0x00002500 main + 102
    25. 20 Final 0x00002491 start + 53
    26. )
    27. terminate called after throwing an instance of 'NSException'
    Alles anzeigen