NSString initWithBytes isNotEqualTo error

Discussion in 'iOS Programming' started by xenep, May 4, 2009.

  1. macrumors newbie

    Joined:
    Mar 24, 2009
    #1
    Hi all,

    i am using soap request in my application and using initWithBytes to convert the retrieved NSMutableData to NSString.

    Code:
    NSString *theXML = [[NSString alloc] initWithBytes: [webData mutableBytes] length:[webData length] encoding:NSUTF8StringEncoding];
    while i am running the app on the simulator everything works fine. but at the iPhone above code quits with the error :

    there is no code that includes 'isNotEqualTo' and the problem does not occure at every request.

    Thanks in advance
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    Looks like the problem might be elsewhere if you're not calling that method in your code.

    BTW, if you're converting an NSData object to an NSString it's probably better to use initWithData:encoding: since you're using the entire data object.
     
  3. thread starter macrumors newbie

    Joined:
    Mar 24, 2009
    #3
    thanx for ur reply but i ve already used 'initWithData:encoding:' and it has the same result :(
     
  4. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
  5. thread starter macrumors newbie

    Joined:
    Mar 24, 2009
    #5
    it should be correct cause it does not ve any problem at simulator.

    i read the thread but i couldnt figure out how to create a gdbinit file. i created a text edit and changed the extension but it was still a text edit, also looked at xCode File->new file but couldnt find a file type that has a . gdbinit extension.
     
  6. macrumors 6502

    mccannmarc

    Joined:
    Aug 15, 2008
    Location:
    Manchester, UK
    #6
    You can also add a symbolic breakpoint which has the same effect as the gdbinit file but only for your current project as opposed to every project (you are better off setting up the gdbinit file if the truth be told but this is a quick way). In Xcode go to Run->Manage Breakpoints->Add Symbolic Breakpoint and type in objc_exception_throw into the textbox. Now when you run your app and it crashes out throwing an exception you will be able to open up the debugger window and look through the stack to find your problem
     
  7. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #7
    Create a text file with the contents shown in that thread and called ~/gdbinit Once the file exists go to the Terminal and enter this command

    mv gdbinit .gdbinit

    Or use TextWrangler, which will open hidden files.
     

Share This Page