Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Objective-c how to convert NSURL into NSString?

Total objective-c noob here with a question. Is there a way to convert NSURL into NSString in one line? I need to retrieve URL from sqlite database abd then save it into string.

Currently the line i want to convert looks like this ->

MyString.url = [NSString stringWithUTF8String:(char *) sqlite3_column_text(sqlStatement, 1)];

so ofcourse im getting 'Incompatible pointer types assigning to 'NSURL *' from 'NSString *''

:)

like image 764
Alan Kałuża Avatar asked Dec 07 '22 00:12

Alan Kałuża


1 Answers

Try This :

NSString *aStrUrl = [aUrlObj absoluteString];
like image 173
Yasika Patel Avatar answered Dec 24 '22 15:12

Yasika Patel