NSString initWithBytes isNotEqualTo error

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

  1. xenep macrumors newbie

    Mar 24, 2009
    Hi all,

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

    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. kainjow Moderator emeritus


    Jun 15, 2000
    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. xenep thread starter macrumors newbie

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


    Sep 2, 2008
  5. xenep thread starter macrumors newbie

    Mar 24, 2009
    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. mccannmarc macrumors 6502


    Aug 15, 2008
    Manchester, UK
    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. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    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