Re: Unable to the intValue from NSString nor NSTextField
Re: Unable to the intValue from NSString nor NSTextField
- Subject: Re: Unable to the intValue from NSString nor NSTextField
- From: Shawn Erickson <email@hidden>
- Date: Tue, 13 Jul 2004 15:50:39 -0700
On Jul 13, 2004, at 2:41 PM, Frederick C. Lee wrote:
Greetings:
I keep getting errors when attempt to get intValue from a
NSTextField; albeit a stringValue is okay.
At the debugger prompt I tested an intValue from a NSString object
with the same problem:
(gdb) po [@"3" intValue]
Cannot access memory at address 0x3
(gdb)
Any solutions?
You are asking an NSString (which has one the letter 3 in it) for an
integer value and then asking GDB to print out that object. The problem
is that intValue returns and integer and an integer isn't and object it
is just a 32b scaler value.
GDB is believing it to be a reference to an object (you told it was by
the command you typed) hence it is trying to use the value of 3 as a
pointer to the object and failing in that attempt.
Try just printing the value out (I believe "p [@"3" intValue]").
Also please don't cross post.
-Shawn
_______________________________________________
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.