discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSLog and " character


From: Riccardo Mottola
Subject: NSLog and " character
Date: Wed, 18 Jan 2012 16:50:19 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20120104 Icedove/8.0

Hi,

I'm expanding a CVS parser in DataBasin. I'm trying to parse a quoted CSV file.

The code snippet is:

NSLog(@"2 %@, remaining: %@", field, [[scanner string] substringFromIndex: [scanner scanLocation]]);
      [scanner scanString:qualifier intoString:&token];
      if (token != nil)
        {
          NSLog(@"token: %@");

now I expect token to be the qualifier ("). NSLog however dies. Why? I get the backtrace below and as you may see, if I print out the object in GDB, it is indeed the string I so expect. Why is NSLog spitting into my face? Did I find some obscure bug or am I missing the obvious in my code?

Thank you,

Riccardo

---
#0 0xb768d926 in objc_msg_lookup () from /usr/lib/i386-linux-gnu/libobjc.so.3
#1  0xb775327b in GSPrivateFormat (s=0xbfffd9c0, format=0xbfffda00,
    ap=0xbfffeb04 "øø\005\bHù\005\bLëÿ¿1", locale=0x0) at GSFormat.m:1856
#2  0xb7770dd7 in -[GSPlaceholderString initWithFormat:locale:arguments:] (
    self=0x80ed4cc, _cmd=0xb7af7460, format=0x838e01c, locale=0x0,
    argList=0xbfffeb04 "øø\005\bHù\005\bLëÿ¿1") at GSString.m:1314
#3  0xb78bd211 in -[NSString initWithFormat:arguments:] (self=0x80ed4cc,
    _cmd=0xb7b2d688, format=0x838e01c,
    argList=0xbfffeb04 "øø\005\bHù\005\bLëÿ¿1") at NSString.m:1152
#4  0xb795e095 in +[NSString(GNUstepBase) stringWithFormat:arguments:] (
    self=0xb7af77e0, _cmd=0xb7ad6bb8, format=0x838e01c,
argList=0xbfffeb04 "øø\005\bHù\005\bLëÿ¿1") at NSString+GNUstepBase.m:46
#5  0xb784c6c1 in NSLogv (format=0x838e01c,
    args=0xbfffeb04 "øø\005\bHù\005\bLëÿ¿1") at NSLog.m:340
#6  0xb784c963 in NSLog (format=0x805fa14) at NSLog.m:247
#7  0x080545f4 in -[DBCVSReader decodeOneLine:] (self=0x83a4ef4,
    _cmd=0x805f8d0, line=0x85c0974) at DBCVSReader.m:174
#8  0x08054151 in -[DBCVSReader getFieldNames:] (self=0x83a4ef4,
    _cmd=0x805f8b0, firstLine=0x85c0974) at DBCVSReader.m:120


(gdb) p token
$1 = (struct NSString *) 0x833d7c4
(gdb) po token
"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]