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

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -