I am trying to take up data from plist. One row in plist has sentences with “\n” in between to change line when displayed in the view controller. But as I am picking up the plist as an array, on casting that element to string using NSString, it is not getting read as a localized string. there is no line change. the whole text is getting displayed along with ‘\n’ in between. how do i make the ‘\n’ work?
Share
What’s happening here is that plist files escape backslashes to make sure they will be displayed as typed. This means that the
\nyou see is stored as\\nwithin the file. If you are using XML storage, open it in a text editor to see this.This problem is discussed and multiple solutions suggested in NSString: newline escape in plist.