2011-05-18 56 views

回答

17

你可以先處理字符串,並將\\n

NSString *newString = [originalString stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"]; 
+4

參數被顛倒取代的\n所有出現。我不得不使用[originalString stringByReplacingOccurrencesOfString:@「\\ n」withString:@「\ n」] – railwayparade 2013-01-15 03:19:55