Converting NSDecimalNumber to NSString

后端 未结 5 1594
伪装坚强ぢ
伪装坚强ぢ 2021-02-02 15:06

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 t

5条回答
  •  星月不相逢
    2021-02-02 15:27

    You need to use the stringWithFormat function:

    NSString *typeId = [NSString stringWithFormat:@"%@", [obj objectForKey:@"TypeID"]];
    

    or stringValue:

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

提交回复
热议问题