• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Unable to the intValue from NSString nor NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


References: 
 >Unable to the intValue from NSString nor NSTextField (From: "Frederick C. Lee" <email@hidden>)

  • Prev by Date: Unable to the intValue from NSString nor NSTextField
  • Next by Date: Xcode 2.0 and 64-bit support
  • Previous by thread: Unable to the intValue from NSString nor NSTextField
  • Next by thread: Xcode 2.0 and 64-bit support
  • Index(es):
    • Date
    • Thread