iphone - How to change file extension from .txt to .rtf in ios programatically? -


how change file extension .txt .rtf in ios programatically?
in xml parsing i'm getting rtf data rtf tags.
possible save data in rtf file without tags? if load file, loading rtf tags in webview.
if open , save file physically, opens in webview.
there way task (file open & save) programatically using ios.

if load rtf file ftp server, upto tables loading(only plain text before tables)

using function of nsstring

nsstring *string2 = [[nsstring alloc] initwithcontentsoffile:@"whateverfile.rtf"]; 

get text file , save in .txt format using

nsmutablestring *mutstr2 = [[nsmutablestring alloc] init]; [mutstr2 setstring: string2]; [mutstr2 writetofile:@"whatevertxt.txt" atomically:yes encoding:nsunicodestringencoding error:&error]; 

you write file in .txt. format... guess best way u want


Comments

Popular posts from this blog

Python __call__ special method practical example -

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -