回答編集履歴

1

修正

2016/06/25 13:24

投稿

_Kentarou
_Kentarou

スコア8490

test CHANGED
@@ -1,7 +1,43 @@
1
- Bundleとして追加している場合は以下になります。
1
+ ## Bundleから読み込む場合
2
2
 
3
3
 
4
4
 
5
5
  ![image](c9ebbe0ef91b191f1b11f2f1178a309e.png)
6
6
 
7
7
  ![image](78474e2ef4dac702309d5bf15d2e7888.png)
8
+
9
+
10
+
11
+ ## Document Folderから読み込む場合
12
+
13
+
14
+
15
+ ```swift
16
+
17
+ import UIKit
18
+
19
+
20
+
21
+ class ViewController: UIViewController {
22
+
23
+
24
+
25
+ override func viewDidLoad() {
26
+
27
+ super.viewDidLoad()
28
+
29
+
30
+
31
+ let paths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true).first! as NSString
32
+
33
+ let path = paths.stringByAppendingPathComponent("Dictionary.plist")
34
+
35
+ let dictionary = NSDictionary(contentsOfFile: path)
36
+
37
+ print(dictionary)
38
+
39
+ }
40
+
41
+ }
42
+
43
+ ```