Converting NSDecimalNumber to NSString

Posted by 4thSpace on Stack Overflow See other posts from Stack Overflow or by 4thSpace
Published on 2010-04-04T05:00:39Z Indexed on 2010/04/04 5:03 UTC
Read the original article Hit count: 562

I'm retrieving a key from an object that looks like this:

po obj
{
  TypeID = 3;
  TypeName = Asset;
}

The key value is being retrieved like this:

NSString *typeId = (NSString*)[obj objectForKey:@"TypeID"];

Rather than typeId being an NSString, it is an NSDecimalNumber. Why is that?

How do I convert it to an NSString?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk