Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added documents directory snippet

  • Loading branch information...
commit ed36712699844f7a546055279f8a16855dc83e7a 1 parent 7929410
Markus Emrich authored March 21, 2013
8  README.md
Source Rendered
@@ -53,6 +53,14 @@ Shortcut for a formatted string
53 53
 
54 54
     [NSString stringWithFormat: @"<#string#>", <#param1#>]
55 55
 
  56
+**getDocumentsDirectory.codesnippet**  (Get Documents directory)  
  57
+Shortcut: `documents`  
  58
+Create path to documents directory
  59
+
  60
+    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  61
+        NSString *documentsDirectory = [paths objectAtIndex:0];
  62
+    NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"<#fileName#>"];
  63
+
56 64
 **importFramework.codesnippet**  (Import Framework)  
57 65
 Shortcut: `imp2`  
58 66
 import a framework
30  getDocumentsDirectory.codesnippet
... ...
@@ -0,0 +1,30 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3
+<plist version="1.0">
  4
+<dict>
  5
+	<key>IDECodeSnippetCompletionPrefix</key>
  6
+	<string>documents</string>
  7
+	<key>IDECodeSnippetCompletionScopes</key>
  8
+	<array>
  9
+		<string>CodeBlock</string>
  10
+	</array>
  11
+	<key>IDECodeSnippetContents</key>
  12
+	<string>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  13
+    NSString *documentsDirectory = [paths objectAtIndex:0];
  14
+NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"&lt;#fileName#&gt;"];</string>
  15
+	<key>IDECodeSnippetIdentifier</key>
  16
+	<string>5D5547B6-84D8-4B0D-88CE-5680D8095581</string>
  17
+	<key>IDECodeSnippetLanguage</key>
  18
+	<string>Xcode.SourceCodeLanguage.Objective-C</string>
  19
+	<key>IDECodeSnippetPlatformFamily</key>
  20
+	<string>iphoneos</string>
  21
+	<key>IDECodeSnippetSummary</key>
  22
+	<string>Create path to documents directory</string>
  23
+	<key>IDECodeSnippetTitle</key>
  24
+	<string>Get Documents directory</string>
  25
+	<key>IDECodeSnippetUserSnippet</key>
  26
+	<true/>
  27
+	<key>IDECodeSnippetVersion</key>
  28
+	<integer>0</integer>
  29
+</dict>
  30
+</plist>

0 notes on commit ed36712

Please sign in to comment.
Something went wrong with that request. Please try again.