Commit 7474ed7
committed
NSData: Improve error handling and new initialiser
Instead of printing out a warning, the underlying file reading function
creates proper NSError objects, that are returned to the user.
The following initializers were implemented:
-[NSData initWithContentsOfFile:options:error:]
-[NSData initWithContentsOfURL:options:error:]
+[NSData dataWithContentsOfFile:options:error:]
+[NSData dataWithContentsOfURL:options:error:]
Additionally NSDataReadingOptions was added to NSData.h.
Please note that NSDataReadingMappedIfSafe, and NSDataReadingMappedAlways
currently have no effect, and need to be implemented properly.1 parent 131f265 commit 7474ed7
3 files changed
Lines changed: 261 additions & 43 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
42 | 51 | | |
43 | 52 | | |
44 | 53 | | |
| |||
95 | 104 | | |
96 | 105 | | |
97 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
98 | 110 | | |
99 | 111 | | |
100 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
101 | 116 | | |
102 | 117 | | |
103 | 118 | | |
| |||
127 | 142 | | |
128 | 143 | | |
129 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
130 | 148 | | |
131 | 149 | | |
132 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
133 | 154 | | |
134 | 155 | | |
135 | 156 | | |
| |||
0 commit comments