XML praser Error

Discussion in 'iOS Programming' started by Monaj, Jun 3, 2009.

  1. Monaj macrumors regular

    Joined:
    May 24, 2009
    #1
    hi
    i made an iphone application when i give the absolute path it run fine.i.e
    NSURL *xmlURL = [NSURL fileURLWithPath:mad:"/Users/Abn/Desktop/iphoneTry/questionBank.xml"];

    But when i give the relative path it did not parse the file.
    NSURL *xmlURL = [NSURL fileURLWithPath:mad:"questionBank.xml"];

    Error:-
    ERROR:Operation could not be completed. (NSXMLParserErrorDomain error 5.)

    In general info tab, path type is : relative to enclosing group
    file type:text.xml


    thanks
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    You can't use relative paths like that, only absolute paths. Use NSSearchPathForDirectoriesInDomains() to find common folders, or NSBundle to get a file in your .app's bundle.
     

Share This Page