Re: NSDecimalNumber & NSString question

2008-11-19 Thread Steven Riggs
I would like to add, if you don't use something to validate the user input of your text fields you, will crash with non numeric characters. Steven Riggs On Nov 19, 2008, at 2:36 AM, Ashley Clark <[EMAIL PROTECTED]> wrote: On Nov 18, 2008, at 4:28 PM, Brooke Gravitt wrote: Hello, I'm tryin

Re: NSDecimalNumber & NSString question

2008-11-18 Thread Ashley Clark
On Nov 18, 2008, at 4:28 PM, Brooke Gravitt wrote: Hello, I'm trying to better acquainted with Cocoa and Obj-C, having some trouble with simple things. Perhaps someone could kindly apply cluebat to skull for me. I'm accepting a couple of string values from a pair of NSTextField and would like

NSDecimalNumber & NSString question

2008-11-18 Thread Brooke Gravitt
Hello, I'm trying to better acquainted with Cocoa and Obj-C, having some trouble with simple things. Perhaps someone could kindly apply cluebat to skull for me. I'm accepting a couple of string values from a pair of NSTextField and would like to take these values and do some math with them, then

Re: NSString Question

2008-08-18 Thread Jason Coco
On Aug 18, 2008, at 15:49 , Ken Thomases wrote: On Aug 18, 2008, at 12:28 PM, Jason Coco wrote: [[thePropertiesInfoPtr->mNameString alloc] initWithCharacters:myStringBufferPtr length:myStringSize]; Um, that's nonsensical. I think you meant: thePropertiesInfoPtr->mNameString = [[NSString

Re: NSString Question

2008-08-18 Thread Ken Thomases
On Aug 18, 2008, at 12:28 PM, Jason Coco wrote: [[thePropertiesInfoPtr->mNameString alloc] initWithCharacters:myStringBufferPtr length:myStringSize]; Um, that's nonsensical. I think you meant: thePropertiesInfoPtr->mNameString = [[NSString alloc] initWithCharacters:myStringBufferPtr lengt

Re: NSString Question

2008-08-18 Thread Shawn Erickson
On Mon, Aug 18, 2008 at 7:54 AM, Dave <[EMAIL PROTECTED]> wrote: > myOSStatus = [self ReadUInt32LEFromPosition: myCurrentFilePosition + 28 > IntPtr:&myBufferSize]; > myOSStatus = [self ReadFromPosition: myCurrentFilePosition + 40 ForSize: > myBufferSize BufferPtr:myStringBufferPtr]; Best to avoi

Re: NSString Question

2008-08-18 Thread Jason Coco
On Aug 18, 2008, at 10:54 , Dave wrote: Hi, I'm tring to create an NSString object from data contained within a file. The following code attempts to do this. The data is read from the file OK and all the size information etc. is OK. Here is a code snippet: myOSStatus = [self ReadUInt32L

Re: NSString Question

2008-08-18 Thread Andy Lee
On Aug 18, 2008, at 10:54 AM, Dave wrote: thePropertiesInfoPtr pointer to a C Structure that contains the following member: NSString* mNameString; As a general note, by mixing structs and objects you're opening the door to nasty memory management bugs. I'd recommend going with obj

Re: NSString Question

2008-08-18 Thread Andy Lee
You haven't mentioned whether you're deliberately avoiding NSFileHandle for some reason. Are you aware of it? It has methods to seek and read. You can get the bytes from the resulting NSData object. On Aug 18, 2008, at 10:54 AM, Dave wrote: [thePropertiesInfoPtr->mNameString initWithCharac

NSString Question

2008-08-18 Thread Dave
Hi, I'm tring to create an NSString object from data contained within a file. The following code attempts to do this. The data is read from the file OK and all the size information etc. is OK. Here is a code snippet: myOSStatus = [self ReadUInt32LEFromPosition: myCurrentFilePosition + 28