Inconsistencies with NSString in GDB
Inconsistencies with NSString in GDB
- Subject: Inconsistencies with NSString in GDB
- From: Marc Weil <email@hidden>
- Date: Mon, 12 May 2003 08:06:24 -0400
Hello,
I have a method in my program that is supposed to check for the number of
e-mail messages on a POP3 server. I am using EDCommon's EDStream class for
the connection to the server. Everything works fine except after I issue the
STAT command to the server to get the number of messages.
Here is the important code:
[_popConnection writeLine: @"STAT"];
statResult = [NSString stringWithString: [_popConnection availableLine]];
resultCode = [[responseRegex substringForSubexpressionAtIndex:1 inString:
statResult] autorelease];
statResult is an NSString pointer.
So, all seems to work well. As I step through the code in the debugger, the
first line goes through okay, and so does the second one. The list of
variables in PB lists statResult as having a valid response from the server,
and the memory address turns red after the second line executes since the
contents of the variable changed.
Now, here's the problem. Even though statResult is reported by PB as having
valid contents, if I issue 'po statResult' to GDB (from with PB of course),
GDB reports that the string has no contents at all. I don't have a
global/member variable named statResult because all of my member variables
are prefixed with an underscore and I don't have any globals to begin with!
The final line in my code example above doesn't work either. It too seems to
think that statResult contains @"" and therefore returns nil.
Why the heck is Project Builder telling me that this variable has a correct
response from the mail server, but everything else seems to be treating
statResult as though it only contained an empty string? This is the only
method in my program where this happens, and I do have other methods that
issue commands to the server using EDStream and parse the response with
MOKit's MORegularExpression. It just doesn't make any sense to me! What am I
doing wrong?
TIA,
Marc Weil
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.