0
我有大約20行文本,需要有一些值,當我使用createFileAtPath
創建文件模板?
[firstname] has a surname of [surname]
and is [gender]
etc etc etc
etc etc etc
etc etc etc
etc etc etc
and lives in [suburb]
我有當用戶點擊一個按鈕
創建該文件的次數可以這樣通過創建某種模板或恆定的做,我可以用我的變量替換佔位符?同樣的事情也給NSString stringWithFormat
稱爲像
[NSString stringWithFormat:myTemplate, person.firstname, person.surname, person.gender, person.suburb]