Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSObject to NSString Objective-C

Can someone help me to convert an NSObject to NSString?

I'm trying to do something like this -

NSString *address = [NSString stringWithFormat:ivpObj.addressStr];

But I got an warning - Format is not a string literal and no format arguments

Please some one help

like image 243
Mohammad Ashraful Kabir Avatar asked Dec 13 '22 12:12

Mohammad Ashraful Kabir


2 Answers

How about this:

NSString *address = [NSString stringWithFormat:@"%@", ivpObj.addressStr];
like image 179
Eimantas Avatar answered Jan 08 '23 22:01

Eimantas


Simpler still:

NSString *address = [ivpObj.addressStr description];
like image 35
Williham Totland Avatar answered Jan 08 '23 22:01

Williham Totland