Explorar o código

Version 7.2

Fixed NSMetadataQuery predicate filter for files without extensions, fixed ubiquity container bug, migrated to auto-synthesized @properties, enabled modules, new compiler checks for modules & ARC & SDK version.
Sam Spencer %!s(int64=11) %!d(string=hai) anos
pai
achega
c2e68e4535
Modificáronse 48 ficheiros con 305 adicións e 212 borrados
  1. 10 0
      CHANGELOG.md
  2. 3 3
      CONTRIBUTING.md
  3. 5 5
      Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/Documents/Classes/iCloud.html
  4. 1 1
      Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/Documents/Classes/iCloudDocument.html
  5. 1 1
      Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/Documents/Protocols/iCloudDelegate.html
  6. 1 1
      Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/Documents/Protocols/iCloudDocumentDelegate.html
  7. 1 1
      Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/Documents/hierarchy.html
  8. 1 1
      Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/Documents/index.html
  9. 1 1
      Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/Tokens1.xml
  10. BIN=BIN
      Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/docSet.dsidx
  11. BIN=BIN
      Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/docSet.dsidx-shm
  12. BIN=BIN
      Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/docSet.dsidx-wal
  13. BIN=BIN
      Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/docSet.skidx
  14. BIN=BIN
      Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/docSet.toc
  15. BIN=BIN
      Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/docSet.tokencache
  16. 5 5
      Documentation/html/Classes/iCloud.html
  17. 1 1
      Documentation/html/Classes/iCloudDocument.html
  18. 1 1
      Documentation/html/Protocols/iCloudDelegate.html
  19. 1 1
      Documentation/html/Protocols/iCloudDocumentDelegate.html
  20. 1 1
      Documentation/html/hierarchy.html
  21. 1 1
      Documentation/html/index.html
  22. BIN=BIN
      Documentation/publish/com.iRareMedia.iCloud-Framework-7.0.xar
  23. 8 8
      Documentation/publish/iRareMedia.atom
  24. 1 1
      LICENSE.md
  25. 1 1
      iCloud App - iOS/AppBanner.png
  26. 1 1
      iCloud App - iOS/iCloud App/AppDelegate.m
  27. 1 1
      iCloud App - iOS/iCloud App/Base.lproj/iPhoneStoryboard.storyboard
  28. 1 1
      iCloud App - iOS/iCloud App/ConflictViewController.m
  29. 1 1
      iCloud App - iOS/iCloud App/DocumentViewController.h
  30. 1 1
      iCloud App - iOS/iCloud App/DocumentViewController.m
  31. 3 2
      iCloud App - iOS/iCloud App/Images.xcassets/AppIcon.appiconset/AppIcon29x29.png
  32. 1 1
      iCloud App - iOS/iCloud App/ListViewController.m
  33. 1 1
      iCloud App - iOS/iCloud App/MHPrettyDate/MHPrettyDate.h
  34. 1 1
      iCloud App - iOS/iCloud App/ShareViewController.m
  35. 1 1
      iCloud App - iOS/iCloud App/WelcomeViewController.h
  36. 1 1
      iCloud App - iOS/iCloud App/WelcomeViewController.m
  37. 1 1
      iCloud App - iOS/iCloud App/en.lproj/InfoPlist.strings
  38. 1 1
      iCloud App - iOS/iCloud AppTests/en.lproj/InfoPlist.strings
  39. 29 5
      iCloud.framework/Versions/A/Headers/iCloud.h
  40. 10 2
      iCloud.framework/Versions/A/Headers/iCloudDocument.h
  41. BIN=BIN
      iCloud.framework/Versions/A/iCloud
  42. BIN=BIN
      iCloud.framework/iCloud
  43. 7 3
      iCloud.xcodeproj/project.pbxproj
  44. BIN=BIN
      iCloud.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  45. 29 5
      iCloud.xcodeproj/project.xcworkspace/xcuserdata/Spencers.xcuserdatad/WorkspaceSettings.xcsettings
  46. 160 146
      iCloud/iCloud.m
  47. 10 2
      iCloud/iCloudDocument.h
  48. 1 1
      iCloud/iCloudDocument.m

+ 10 - 0
CHANGELOG.md

@@ -2,6 +2,16 @@
 The following details changes made to iCloud Document Sync with each version. For more detailed information, see the Releases and Commits section of the GitHub project.
 
 <table>
+    <tr><th colspan="2" style="text-align:center;"><b>Version 7.2</b></th></tr>
+    <tr>
+        <td>Fixed NSMetadataQuery predicate filter for files without extensions, fixed ubiquity container bug, migrated to auto-synthesized @properties, enabled modules (new compiler checks for modules), new compiler checks for ARC, new compiler checks for SDK version.
+        </td>
+    </tr>
+    <tr><th colspan="2" style="text-align:center;"><b>Version 7.1</b></th></tr>
+    <tr>
+        <td>Updated init method, fixed double-init of singleton, fixed bug when saving documents, new delegate method, fixed ubiquity URL bugs.
+        </td>
+    </tr>
     <tr><th colspan="2" style="text-align:center;"><b>Version 7.0</b></th></tr>
     <tr>
         <td>Major changes in favor of stability and security. iCloud Document Sync is now a <b>singleton</b>. There are numerous new and updated methods. New delegate methods and protocols. New iCloudDocument features. Automated documentation and framework builds for easier contribution. Plus it fixes numerous bugs and adds an iOS Sample app.

+ 3 - 3
CONTRIBUTING.md

@@ -9,9 +9,9 @@
 	<key>CFBundleName</key>
 	<string>iCloud Framework Documentation</string>
 	<key>CFBundleShortVersionString</key>
-	<string>7.0</string>
+	<string>7.2</string>
 	<key>CFBundleVersion</key>
-	<string>7.0</string>
+	<string>7.2</string>
 	
 	
 	
@@ -32,6 +32,6 @@
 	<key>DocSetPublisherName</key>
 	<string>iRare Media</string>
 	<key>NSHumanReadableCopyright</key>
-	<string>Copyright © 2013 iRare Media. All rights reserved.</string>
+	<string>Copyright © 2014 iRare Media. All rights reserved.</string>
 </dict>
 </plist>

+ 5 - 5
Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/Documents/Classes/iCloud.html

@@ -288,7 +288,7 @@
 					<div class="section section-overview">
 						<a title="Overview" name="overview"></a>
 						<h2 class="subtitle subtitle-overview">Overview</h2>
-						<p>iCloud Document Sync helps integrate iCloud into iOS (OS X coming soon) Objective-C document projects with one-line code methods. Sync, upload, manage, and remove documents to and from iCloud with only a few lines of code (compared to the hundreds of lines and hours that it usually takes). Updates and more details on this project can be found on <a href="http://www.github.com/iRareMedia/iCloudDocumentSync">GitHub</a>. If you like the project, please <a href="https://github.com/iRareMedia/iCloudDocumentSync">star it</a> on GitHub!</p>
+						<p>iCloud Document Sync makes it easy for developers to integrate the iCloud document storage APIs into iOS applications. This is how iCloud document-storage and management should&rsquo;ve been out of the box from Apple. Integrate iCloud into iOS (OS X coming soon) Objective-C document projects with one-line code methods. Sync, upload, manage, and remove documents to and from iCloud with only a few lines of code (compared to the hundreds of lines and hours that it usually takes). Get iCloud up and running in your iOS app in only a few minutes. Updates and more details on this project can be found on <a href="http://www.github.com/iRareMedia/iCloudDocumentSync">GitHub</a>. If you like the project, please star it on GitHub!</p>
 
 <p>The <code>iCloud</code> class provides methods to integrate iCloud into document projects.</p>
 
@@ -300,9 +300,9 @@
 <li>Subscribe to the <a href="../Protocols/iCloudDelegate.html"><code>iCloudDelegate</code></a> <a href="#//api/name/delegate">delegate</a>.</li>
 <li><p>Call the following methods to setup iCloud when your app starts:</p>
 
-<pre><code> iCloud *cloud = [[iCloud sharedCloud] init]; // This will help to begin the sync process and register for document updates.
- [cloud setDelegate:self]; // Set this if you plan to use the delegate
-</code></pre></li>
+<p> [[iCloud sharedCloud] setDelegate:self]; // Set this if you plan to use the delegate
+ [[iCloud sharedCloud] setVerboseLogging:YES]; // We want detailed feedback about what&rsquo;s going on with iCloud, this is OFF by default
+ [[iCloud sharedCloud] updateFiles]; // Force iCloud Update: This is done automatically when changes are made, but we want to make sure the view is always updated when presented</p></li>
 </ol>
 <div class="warning"><p><strong>Warning:</strong> Only available on iOS 5.1 and later on apps with valid code signing and entitlements. Requires Xcode 5.0.1 and later. Check the online documentation for more information on setting up iCloud in your app.</p></div>
 					</div>
@@ -2453,7 +2453,7 @@
 				<div id="footer">
 					<hr />
 					<div class="footer-copyright">
-						<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-12-03)</span><br />
+						<p><span class="copyright">&copy; 2014 iRare Media. All rights reserved. (Last updated: 2014-01-25)</span><br />
 						
 						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
 						

+ 1 - 1
Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/Documents/Classes/iCloudDocument.html

@@ -452,7 +452,7 @@
 				<div id="footer">
 					<hr />
 					<div class="footer-copyright">
-						<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-12-03)</span><br />
+						<p><span class="copyright">&copy; 2014 iRare Media. All rights reserved. (Last updated: 2014-01-25)</span><br />
 						
 						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
 						

+ 1 - 1
Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/Documents/Protocols/iCloudDelegate.html

@@ -1003,7 +1003,7 @@
 				<div id="footer">
 					<hr />
 					<div class="footer-copyright">
-						<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-12-03)</span><br />
+						<p><span class="copyright">&copy; 2014 iRare Media. All rights reserved. (Last updated: 2014-01-25)</span><br />
 						
 						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
 						

+ 1 - 1
Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/Documents/Protocols/iCloudDocumentDelegate.html

@@ -211,7 +211,7 @@
 				<div id="footer">
 					<hr />
 					<div class="footer-copyright">
-						<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-12-03)</span><br />
+						<p><span class="copyright">&copy; 2014 iRare Media. All rights reserved. (Last updated: 2014-01-25)</span><br />
 						
 						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
 						

+ 1 - 1
Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/Documents/hierarchy.html

@@ -79,7 +79,7 @@
 				<div id="footer">
 					<hr />
 					<div class="footer-copyright">
-						<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-12-03)</span><br />
+						<p><span class="copyright">&copy; 2014 iRare Media. All rights reserved. (Last updated: 2014-01-25)</span><br />
 						
 						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
 						

+ 1 - 1
Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/Documents/index.html

@@ -69,7 +69,7 @@
 				<div id="footer">
 					<hr />
 					<div class="footer-copyright">
-						<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-12-03)</span><br />
+						<p><span class="copyright">&copy; 2014 iRare Media. All rights reserved. (Last updated: 2014-01-25)</span><br />
 						
 						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
 						

+ 1 - 1
Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/Tokens1.xml

@@ -4,7 +4,7 @@
 		
 		<Token>
 			<TokenIdentifier>//apple_ref/occ/cl/iCloud</TokenIdentifier>
-			<Abstract type="html">iCloud Document Sync helps integrate iCloud into iOS (OS X coming soon) Objective-C document projects with one-line code methods. Sync, upload, manage, and remove documents to and from iCloud with only a few lines of code (compared to the hundreds of lines and hours that it usually takes). Updates and more details on this project can be found on GitHub. If you like the project, please star it on GitHub!</Abstract>
+			<Abstract type="html">iCloud Document Sync makes it easy for developers to integrate the iCloud document storage APIs into iOS applications. This is how iCloud document-storage and management should&apos;ve been out of the box from Apple. Integrate iCloud into iOS (OS X coming soon) Objective-C document projects with one-line code methods. Sync, upload, manage, and remove documents to and from iCloud with only a few lines of code (compared to the hundreds of lines and hours that it usually takes). Get iCloud up and running in your iOS app in only a few minutes. Updates and more details on this project can be found on GitHub. If you like the project, please star it on GitHub!</Abstract>
 			<DeclaredIn>iCloud.h</DeclaredIn>
 			
 			<NodeRef refid="1"/>

BIN=BIN
Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/docSet.dsidx


BIN=BIN
Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/docSet.dsidx-shm


BIN=BIN
Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/docSet.dsidx-wal


BIN=BIN
Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/docSet.skidx


BIN=BIN
Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/docSet.toc


BIN=BIN
Documentation/com.iRareMedia.iCloud-Framework.docset/Contents/Resources/docSet.tokencache


+ 5 - 5
Documentation/html/Classes/iCloud.html

@@ -288,7 +288,7 @@
 					<div class="section section-overview">
 						<a title="Overview" name="overview"></a>
 						<h2 class="subtitle subtitle-overview">Overview</h2>
-						<p>iCloud Document Sync helps integrate iCloud into iOS (OS X coming soon) Objective-C document projects with one-line code methods. Sync, upload, manage, and remove documents to and from iCloud with only a few lines of code (compared to the hundreds of lines and hours that it usually takes). Updates and more details on this project can be found on <a href="http://www.github.com/iRareMedia/iCloudDocumentSync">GitHub</a>. If you like the project, please <a href="https://github.com/iRareMedia/iCloudDocumentSync">star it</a> on GitHub!</p>
+						<p>iCloud Document Sync makes it easy for developers to integrate the iCloud document storage APIs into iOS applications. This is how iCloud document-storage and management should&rsquo;ve been out of the box from Apple. Integrate iCloud into iOS (OS X coming soon) Objective-C document projects with one-line code methods. Sync, upload, manage, and remove documents to and from iCloud with only a few lines of code (compared to the hundreds of lines and hours that it usually takes). Get iCloud up and running in your iOS app in only a few minutes. Updates and more details on this project can be found on <a href="http://www.github.com/iRareMedia/iCloudDocumentSync">GitHub</a>. If you like the project, please star it on GitHub!</p>
 
 <p>The <code>iCloud</code> class provides methods to integrate iCloud into document projects.</p>
 
@@ -300,9 +300,9 @@
 <li>Subscribe to the <a href="../Protocols/iCloudDelegate.html"><code>iCloudDelegate</code></a> <a href="#//api/name/delegate">delegate</a>.</li>
 <li><p>Call the following methods to setup iCloud when your app starts:</p>
 
-<pre><code> iCloud *cloud = [[iCloud sharedCloud] init]; // This will help to begin the sync process and register for document updates.
- [cloud setDelegate:self]; // Set this if you plan to use the delegate
-</code></pre></li>
+<p> [[iCloud sharedCloud] setDelegate:self]; // Set this if you plan to use the delegate
+ [[iCloud sharedCloud] setVerboseLogging:YES]; // We want detailed feedback about what&rsquo;s going on with iCloud, this is OFF by default
+ [[iCloud sharedCloud] updateFiles]; // Force iCloud Update: This is done automatically when changes are made, but we want to make sure the view is always updated when presented</p></li>
 </ol>
 <div class="warning"><p><strong>Warning:</strong> Only available on iOS 5.1 and later on apps with valid code signing and entitlements. Requires Xcode 5.0.1 and later. Check the online documentation for more information on setting up iCloud in your app.</p></div>
 					</div>
@@ -2453,7 +2453,7 @@
 				<div id="footer">
 					<hr />
 					<div class="footer-copyright">
-						<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-12-03)</span><br />
+						<p><span class="copyright">&copy; 2014 iRare Media. All rights reserved. (Last updated: 2014-01-25)</span><br />
 						
 						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
 						

+ 1 - 1
Documentation/html/Classes/iCloudDocument.html

@@ -452,7 +452,7 @@
 				<div id="footer">
 					<hr />
 					<div class="footer-copyright">
-						<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-12-03)</span><br />
+						<p><span class="copyright">&copy; 2014 iRare Media. All rights reserved. (Last updated: 2014-01-25)</span><br />
 						
 						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
 						

+ 1 - 1
Documentation/html/Protocols/iCloudDelegate.html

@@ -1003,7 +1003,7 @@
 				<div id="footer">
 					<hr />
 					<div class="footer-copyright">
-						<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-12-03)</span><br />
+						<p><span class="copyright">&copy; 2014 iRare Media. All rights reserved. (Last updated: 2014-01-25)</span><br />
 						
 						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
 						

+ 1 - 1
Documentation/html/Protocols/iCloudDocumentDelegate.html

@@ -211,7 +211,7 @@
 				<div id="footer">
 					<hr />
 					<div class="footer-copyright">
-						<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-12-03)</span><br />
+						<p><span class="copyright">&copy; 2014 iRare Media. All rights reserved. (Last updated: 2014-01-25)</span><br />
 						
 						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
 						

+ 1 - 1
Documentation/html/hierarchy.html

@@ -79,7 +79,7 @@
 				<div id="footer">
 					<hr />
 					<div class="footer-copyright">
-						<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-12-03)</span><br />
+						<p><span class="copyright">&copy; 2014 iRare Media. All rights reserved. (Last updated: 2014-01-25)</span><br />
 						
 						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
 						

+ 1 - 1
Documentation/html/index.html

@@ -69,7 +69,7 @@
 				<div id="footer">
 					<hr />
 					<div class="footer-copyright">
-						<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-12-03)</span><br />
+						<p><span class="copyright">&copy; 2014 iRare Media. All rights reserved. (Last updated: 2014-01-25)</span><br />
 						
 						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
 						

BIN=BIN
Documentation/publish/com.iRareMedia.iCloud-Framework-7.0.xar


+ 8 - 8
Documentation/publish/iRareMedia.atom

@@ -1,20 +1,20 @@
 <?xml version="1.0" standalone="no"?>
 <feed xmlns="http://www.w3.org/2005/Atom" xmlns:docset="http://developer.apple.com/rss/docset_extensions" xml:lang="en">
-    <id>https://github.com/iRareMedia/iCloudDocumentSync/tree/master/Documentation//publish/iRareMedia.atom/20131203210755</id>
+    <id>https://github.com/iRareMedia/iCloudDocumentSync/tree/master/Documentation//publish/iRareMedia.atom/20140125001428</id>
     <title type="text">iCloud Framework Documentation</title>
-    <rights>Copyright © 2013 iRare Media. All rights reserved.</rights>
+    <rights>Copyright © 2014 iRare Media. All rights reserved.</rights>
     <link rel="self" href="https://github.com/iRareMedia/iCloudDocumentSync/tree/master/Documentation//publish/iRareMedia.atom"></link>
     <docset:publisherName>iRare Media</docset:publisherName>
     <docset:publisherID>com.iRareMedia.documentation</docset:publisherID>
-    <updated>2013-12-03T21:07:55-05:00</updated>
+    <updated>2014-01-25T00:14:28-05:00</updated>
     <entry>
-        <id>tag:github.com,2013-12-03:com.iRareMedia.iCloud-Framework/7.0.0</id>
+        <id>tag:github.com,2014-01-25:com.iRareMedia.iCloud-Framework/7.2.0</id>
         <title type="text">iCloud Framework Documentation</title>
-        <updated>2013-12-03T21:07:55-05:00</updated>
-        <content type="text">iCloud Framework Documentation (v7.0.0)</content>
-        <link rel="enclosure" type="application/octet-stream" href="https:/github.com/iRareMedia/iCloudDocumentSync/tree/master/Documentation/com.iRareMedia.iCloud-Framework-7.0.xar" length="106399"></link>
+        <updated>2014-01-25T00:14:28-05:00</updated>
+        <content type="text">iCloud Framework Documentation (v7.2.0)</content>
+        <link rel="enclosure" type="application/octet-stream" href="https:/github.com/iRareMedia/iCloudDocumentSync/tree/master/Documentation/com.iRareMedia.iCloud-Framework-7.2.xar" length="107782"></link>
         <docset:identifier>com.iRareMedia.iCloud-Framework</docset:identifier>
-        <docset:version>7.0.0</docset:version>
+        <docset:version>7.2.0</docset:version>
         <docset:minimumXcodeVersion>3.0.0</docset:minimumXcodeVersion>
     </entry>
 </feed>

+ 1 - 1
LICENSE.md

@@ -38,7 +38,7 @@ The iOS Sample App included with this project demonstrates how to use many of th
 <img width=700 src="https://raw.github.com/iRareMedia/iCloudDocumentSync/feature/iCloud%20App%20-%20iOS/AppBanner.png"/>
 
 # Documentation
-All methods, properties, types, and delegate methods available on the iCloud class are documented below. If you're using [Xcode 5](https://developer.apple.com/technologies/tools/whats-new.html) with iCloud Document Sync, documentation is available directly within Xcode (just Option-Click any method for Quick Help). For more advanced documentation in Xcode 4.0+ please install the docset included with this project. This will allow you to view iCloud Document Sync documentation inside of Xcode's Organizer Window.
+Key methods, properties, types, and delegate methods available on the iCloud class are documented below. If you're using [Xcode 5](https://developer.apple.com/technologies/tools/whats-new.html) with iCloud Document Sync, documentation is available directly within Xcode (just Option-Click any method for Quick Help). For more advanced documentation in Xcode 4.0+ please install the docset included with this project. This will allow you to view iCloud Document Sync documentation inside of Xcode's Organizer Window. Additional documentation can also be found on the Wiki page (including how to register your app for iCloud, iCloud fundamentals, etc.).
 
 ## Setup
 Adding iCloud Document Sync to your project is easy. Follow these steps below to get everything up and running.

+ 1 - 1
iCloud App - iOS/AppBanner.png


+ 1 - 1
iCloud App - iOS/iCloud App/AppDelegate.m

@@ -3,7 +3,7 @@
 //  iCloud App
 //
 //  Created by iRare Media on 11/8/13.
-//  Copyright (c) 2013 iRare Media. All rights reserved.
+//  Copyright (c) 2014 iRare Media. All rights reserved.
 //
 
 #import "AppDelegate.h"

+ 1 - 1
iCloud App - iOS/iCloud App/Base.lproj/iPhoneStoryboard.storyboard

@@ -3,7 +3,7 @@
 //  iCloud App
 //
 //  Created by iRare Media on 11/26/13.
-//  Copyright (c) 2013 iRare Media. All rights reserved.
+//  Copyright (c) 2014 iRare Media. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 1 - 1
iCloud App - iOS/iCloud App/ConflictViewController.m

@@ -3,7 +3,7 @@
 //  iCloud App
 //
 //  Created by iRare Media on 11/26/13.
-//  Copyright (c) 2013 iRare Media. All rights reserved.
+//  Copyright (c) 2014 iRare Media. All rights reserved.
 //
 
 #import "ConflictViewController.h"

+ 1 - 1
iCloud App - iOS/iCloud App/DocumentViewController.h

@@ -3,7 +3,7 @@
 //  iCloud App
 //
 //  Created by iRare Media on 11/8/13.
-//  Copyright (c) 2013 iRare Media. All rights reserved.
+//  Copyright (c) 2014 iRare Media. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 1 - 1
iCloud App - iOS/iCloud App/DocumentViewController.m

@@ -3,7 +3,7 @@
 //  iCloud App
 //
 //  Created by iRare Media on 11/8/13.
-//  Copyright (c) 2013 iRare Media. All rights reserved.
+//  Copyright (c) 2014 iRare Media. All rights reserved.
 //
 
 #import "DocumentViewController.h"

+ 3 - 2
iCloud App - iOS/iCloud App/Images.xcassets/AppIcon.appiconset/AppIcon29x29.png


+ 1 - 1
iCloud App - iOS/iCloud App/ListViewController.m

@@ -3,7 +3,7 @@
 //  iCloud App
 //
 //  Created by iRare Media on 11/8/13.
-//  Copyright (c) 2013 iRare Media. All rights reserved.
+//  Copyright (c) 2014 iRare Media. All rights reserved.
 //
 
 #import "ListViewController.h"

+ 1 - 1
iCloud App - iOS/iCloud App/MHPrettyDate/MHPrettyDate.h

@@ -3,7 +3,7 @@
 //  iCloud App
 //
 //  Created by iRare Media on 11/24/13.
-//  Copyright (c) 2013 iRare Media. All rights reserved.
+//  Copyright (c) 2014 iRare Media. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 1 - 1
iCloud App - iOS/iCloud App/ShareViewController.m

@@ -3,7 +3,7 @@
 //  iCloud App
 //
 //  Created by iRare Media on 11/24/13.
-//  Copyright (c) 2013 iRare Media. All rights reserved.
+//  Copyright (c) 2014 iRare Media. All rights reserved.
 //
 
 #import "ShareViewController.h"

+ 1 - 1
iCloud App - iOS/iCloud App/WelcomeViewController.h

@@ -3,7 +3,7 @@
 //  iCloud App
 //
 //  Created by iRare Media on 11/8/13.
-//  Copyright (c) 2013 iRare Media. All rights reserved.
+//  Copyright (c) 2014 iRare Media. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 1 - 1
iCloud App - iOS/iCloud App/WelcomeViewController.m

@@ -3,7 +3,7 @@
 //  iCloud App
 //
 //  Created by iRare Media on 11/8/13.
-//  Copyright (c) 2013 iRare Media. All rights reserved.
+//  Copyright (c) 2014 iRare Media. All rights reserved.
 //
 
 #import "WelcomeViewController.h"

+ 1 - 1
iCloud App - iOS/iCloud App/en.lproj/InfoPlist.strings

@@ -3,7 +3,7 @@
 //  iCloud App
 //
 //  Created by iRare Media on 11/8/13.
-//  Copyright (c) 2013 iRare Media. All rights reserved.
+//  Copyright (c) 2014 iRare Media. All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 1 - 1
iCloud App - iOS/iCloud AppTests/en.lproj/InfoPlist.strings

@@ -3,7 +3,7 @@
 //  iCloud AppTests
 //
 //  Created by iRare Media on 11/8/13.
-//  Copyright (c) 2013 iRare Media. All rights reserved.
+//  Copyright (c) 2014 iRare Media. All rights reserved.
 //
 
 #import <XCTest/XCTest.h>

+ 29 - 5
iCloud.framework/Versions/A/Headers/iCloud.h

@@ -2,16 +2,39 @@
 //  iCloud.h
 //  iCloud Document Sync
 //
-//  Created by iRare Media. Last updated November 2013.
+//  Created by iRare Media. Last updated January 2014.
 //  Available on GitHub. Licensed under MIT with Attribution.
 //
 
-#import <Foundation/Foundation.h>
+// Check for Objective-C Modules
+#if __has_feature(objc_modules)
+    // We recommend enabling Objective-C Modules in your project Build Settings for numerous benefits over regular #imports. Read more from the Modules documentation: http://clang.llvm.org/docs/Modules.html
+    @import Foundation;
+    @import UIKit;
+#else
+    #import <Foundation/Foundation.h>
+    #import <UIKit/UIKit.h>
+#endif
+
+// Import iCloudDocument
 #import <iCloud/iCloudDocument.h>
 
+// Check for ARC
+#if !__has_feature(objc_arc)
+    // Add the -fobjc-arc flag to enable ARC for only these files, as described in the ARC documentation: http://clang.llvm.org/docs/AutomaticReferenceCounting.html
+    #error iCloudDocumentSync is built with Objective-C ARC. You must enable ARC for iCloudDocumentSync.
+#endif
+
+// Ensure that the build is for iOS 5.1 or higher
+#ifndef __IPHONE_5_1
+    #error iCloudDocumentSync is built with features only available is iOS SDK 5.1 and later.
+#endif
+
+// Create a constant for accessing the documents directory
 #define DOCUMENT_DIRECTORY @"Documents"
 
-/** iCloud Document Sync helps integrate iCloud into iOS (OS X coming soon) Objective-C document projects with one-line code methods. Sync, upload, manage, and remove documents to and from iCloud with only a few lines of code (compared to the hundreds of lines and hours that it usually takes). Updates and more details on this project can be found on [GitHub](http://www.github.com/iRareMedia/iCloudDocumentSync). If you like the project, please [star it](https://github.com/iRareMedia/iCloudDocumentSync) on GitHub!
+
+/** iCloud Document Sync makes it easy for developers to integrate the iCloud document storage APIs into iOS applications. This is how iCloud document-storage and management should've been out of the box from Apple. Integrate iCloud into iOS (OS X coming soon) Objective-C document projects with one-line code methods. Sync, upload, manage, and remove documents to and from iCloud with only a few lines of code (compared to the hundreds of lines and hours that it usually takes). Get iCloud up and running in your iOS app in only a few minutes. Updates and more details on this project can be found on [GitHub](http://www.github.com/iRareMedia/iCloudDocumentSync). If you like the project, please star it on GitHub!
  
  The `iCloud` class provides methods to integrate iCloud into document projects.
  
@@ -22,8 +45,9 @@
  3. Subscribe to the `<iCloudDelegate>` delegate.
  4. Call the following methods to setup iCloud when your app starts:
  
-        iCloud *cloud = [[iCloud sharedCloud] init]; // This will help to begin the sync process and register for document updates.
-        [cloud setDelegate:self]; // Set this if you plan to use the delegate
+    [[iCloud sharedCloud] setDelegate:self]; // Set this if you plan to use the delegate
+    [[iCloud sharedCloud] setVerboseLogging:YES]; // We want detailed feedback about what's going on with iCloud, this is OFF by default
+    [[iCloud sharedCloud] updateFiles]; // Force iCloud Update: This is done automatically when changes are made, but we want to make sure the view is always updated when presented
  
  
  @warning Only available on iOS 5.1 and later on apps with valid code signing and entitlements. Requires Xcode 5.0.1 and later. Check the online documentation for more information on setting up iCloud in your app. */

+ 10 - 2
iCloud.framework/Versions/A/Headers/iCloudDocument.h

@@ -2,11 +2,19 @@
 //  iCloudDocument.h
 //  iCloud Document Sync
 //
-//  Created by iRare Media. Last updated November 2013.
+//  Created by iRare Media. Last updated January 2014.
 //  Available on GitHub. Licensed under MIT with Attribution.
 //
 
-#import <UIKit/UIKit.h>
+// Check for Objective-C Modules
+#if __has_feature(objc_modules)
+    // We recommend enabling Objective-C Modules in your project Build Settings for numerous benefits over regular #imports. Read more from the Modules documentation: http://clang.llvm.org/docs/Modules.html
+    @import Foundation;
+    @import UIKit;
+#else
+    #import <Foundation/Foundation.h>
+    #import <UIKit/UIKit.h>
+#endif
 
 /** Use the iCloudDocument class (a subclass of UIDocument) to read and write documents managed by the iCloud class. You should rarely interact directly with iCloudDocument. The iCloud class manages all interactions with iCloudDocument. You can however retieve an iCloudDocument object by specifying its URL in the iCloud class.
  

BIN=BIN
iCloud.framework/Versions/A/iCloud


BIN=BIN
iCloud.framework/iCloud


+ 7 - 3
iCloud.xcodeproj/project.pbxproj

@@ -42,6 +42,7 @@
 		9994D1B816FE3B7E00AB071B /* iCloudDocument.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9994D1B516FE3B3B00AB071B /* iCloudDocument.h */; };
 		9994D1C316FE3CF600AB071B /* iCloud.h in Headers */ = {isa = PBXBuildFile; fileRef = 9994D1AC16FE3ABF00AB071B /* iCloud.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		9994D1C416FE3CF600AB071B /* iCloudDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 9994D1B516FE3B3B00AB071B /* iCloudDocument.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		99AF6A711893837600D4BCB7 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 996A9B7F177C8DCA0030039A /* UIKit.framework */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -104,8 +105,8 @@
 		9994D1B516FE3B3B00AB071B /* iCloudDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iCloudDocument.h; sourceTree = "<group>"; };
 		9994D1B616FE3B3B00AB071B /* iCloudDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iCloudDocument.m; sourceTree = "<group>"; };
 		99AD4ABC1837C392008BBEA4 /* iCloud App.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "iCloud App.xcodeproj"; path = "iCloud App - iOS/iCloud App.xcodeproj"; sourceTree = "<group>"; };
+		99AF6A6718937E6A00D4BCB7 /* com.iRareMedia.iCloud-Framework-7.2.xar */ = {isa = PBXFileReference; lastKnownFileType = file; path = "com.iRareMedia.iCloud-Framework-7.2.xar"; sourceTree = "<group>"; };
 		99B41B2018490C3A0096FD9D /* iCloudDocumentDelegate.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html.documentation; path = iCloudDocumentDelegate.html; sourceTree = "<group>"; };
-		99B41B23184938A60096FD9D /* com.iRareMedia.iCloud-Framework-7.0.xar */ = {isa = PBXFileReference; lastKnownFileType = file; path = "com.iRareMedia.iCloud-Framework-7.0.xar"; sourceTree = "<group>"; };
 		99B41B24184938AB0096FD9D /* com.iRareMedia.iCloud-Framework.docset */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = "com.iRareMedia.iCloud-Framework.docset"; sourceTree = "<group>"; };
 		99FB11851842F0BC00406254 /* iCloud.html */ = {isa = PBXFileReference; lastKnownFileType = text.html.documentation; path = iCloud.html; sourceTree = "<group>"; };
 		99FB11861842F0BC00406254 /* iCloudDocument.html */ = {isa = PBXFileReference; lastKnownFileType = text.html.documentation; path = iCloudDocument.html; sourceTree = "<group>"; };
@@ -128,6 +129,7 @@
 			buildActionMask = 2147483647;
 			files = (
 				9994D1A816FE3ABF00AB071B /* Foundation.framework in Frameworks */,
+				99AF6A711893837600D4BCB7 /* UIKit.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -270,7 +272,7 @@
 		99FB11941842F0BC00406254 /* publish */ = {
 			isa = PBXGroup;
 			children = (
-				99B41B23184938A60096FD9D /* com.iRareMedia.iCloud-Framework-7.0.xar */,
+				99AF6A6718937E6A00D4BCB7 /* com.iRareMedia.iCloud-Framework-7.2.xar */,
 				99FB11961842F0BC00406254 /* iRareMedia.atom */,
 			);
 			path = publish;
@@ -417,7 +419,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "# Start constants\ncompany=\"iRare Media\";\ncompanyID=\"com.iRareMedia\";\ncompanyURL=\"http://www.iRareMedia.com\";\ngitHubURL=\"https://github.com/iRareMedia/iCloudDocumentSync/tree/master/Documentation/\";\nversion=\"7.0\";\ntarget=\"iphoneos\";\n#target=\"macosx\";\noutputPath=\"${PROJECT_DIR}/Documentation\"; #\"${BUILT_PRODUCTS_DIR}\" #\"~/help\";\n# End constants\n/usr/local/bin/appledoc \\\n--project-name \"${PROJECT_NAME} Framework\" \\\n--project-company \"${company}\" \\\n--project-version \"${version}\" \\\n--company-id \"${companyID}\" \\\n--docset-atom-filename \"iRareMedia.atom\" \\\n--docset-feed-url \"${gitHubURL}/publish/%DOCSETATOMFILENAME\" \\\n--docset-package-url \"${gitHubURL}/%DOCSETPACKAGEFILENAME\" \\\n--docset-fallback-url \"${gitHubURL}\" \\\n--output \"${outputPath}\" \\\n--publish-docset \\\n--docset-platform-family \"${target}\" \\\n--logformat xcode \\\n--keep-intermediate-files \\\n--no-repeat-first-par \\\n--no-warn-invalid-crossref \\\n--ignore \"*.m\" \\\n--install-docset \\\n--docset-install-path \"${outputPath}\" \\\n--exit-threshold 2 \\\n\"${PROJECT_DIR}/iCloud\"";
+			shellScript = "# Start constants\ncompany=\"iRare Media\";\ncompanyID=\"com.iRareMedia\";\ncompanyURL=\"http://www.iRareMedia.com\";\ngitHubURL=\"https://github.com/iRareMedia/iCloudDocumentSync/tree/master/Documentation/\";\nversion=\"7.2\";\ntarget=\"iphoneos\";\n#target=\"macosx\";\noutputPath=\"${PROJECT_DIR}/Documentation\"; #\"${BUILT_PRODUCTS_DIR}\" #\"~/help\";\n# End constants\n/usr/local/bin/appledoc \\\n--project-name \"${PROJECT_NAME} Framework\" \\\n--project-company \"${company}\" \\\n--project-version \"${version}\" \\\n--company-id \"${companyID}\" \\\n--docset-atom-filename \"iRareMedia.atom\" \\\n--docset-feed-url \"${gitHubURL}/publish/%DOCSETATOMFILENAME\" \\\n--docset-package-url \"${gitHubURL}/%DOCSETPACKAGEFILENAME\" \\\n--docset-fallback-url \"${gitHubURL}\" \\\n--output \"${outputPath}\" \\\n--publish-docset \\\n--docset-platform-family \"${target}\" \\\n--logformat xcode \\\n--keep-intermediate-files \\\n--no-repeat-first-par \\\n--no-warn-invalid-crossref \\\n--ignore \"*.m\" \\\n--install-docset \\\n--docset-install-path \"${outputPath}\" \\\n--exit-threshold 2 \\\n\"${PROJECT_DIR}/iCloud\"";
 		};
 /* End PBXShellScriptBuildPhase section */
 
@@ -508,6 +510,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
+				CLANG_ENABLE_MODULES = YES;
 				COPY_PHASE_STRIP = NO;
 				DEAD_CODE_STRIPPING = NO;
 				DSTROOT = /tmp/iCloud.dst;
@@ -528,6 +531,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
+				CLANG_ENABLE_MODULES = YES;
 				COPY_PHASE_STRIP = NO;
 				DEAD_CODE_STRIPPING = NO;
 				DSTROOT = /tmp/iCloud.dst;

BIN=BIN
iCloud.xcodeproj/project.xcworkspace/contents.xcworkspacedata


+ 29 - 5
iCloud.xcodeproj/project.xcworkspace/xcuserdata/Spencers.xcuserdatad/WorkspaceSettings.xcsettings

@@ -2,16 +2,39 @@
 //  iCloud.h
 //  iCloud Document Sync
 //
-//  Created by iRare Media. Last updated November 2013.
+//  Created by iRare Media. Last updated January 2014.
 //  Available on GitHub. Licensed under MIT with Attribution.
 //
 
-#import <Foundation/Foundation.h>
+// Check for Objective-C Modules
+#if __has_feature(objc_modules)
+    // We recommend enabling Objective-C Modules in your project Build Settings for numerous benefits over regular #imports. Read more from the Modules documentation: http://clang.llvm.org/docs/Modules.html
+    @import Foundation;
+    @import UIKit;
+#else
+    #import <Foundation/Foundation.h>
+    #import <UIKit/UIKit.h>
+#endif
+
+// Import iCloudDocument
 #import <iCloud/iCloudDocument.h>
 
+// Check for ARC
+#if !__has_feature(objc_arc)
+    // Add the -fobjc-arc flag to enable ARC for only these files, as described in the ARC documentation: http://clang.llvm.org/docs/AutomaticReferenceCounting.html
+    #error iCloudDocumentSync is built with Objective-C ARC. You must enable ARC for iCloudDocumentSync.
+#endif
+
+// Ensure that the build is for iOS 5.1 or higher
+#ifndef __IPHONE_5_1
+    #error iCloudDocumentSync is built with features only available is iOS SDK 5.1 and later.
+#endif
+
+// Create a constant for accessing the documents directory
 #define DOCUMENT_DIRECTORY @"Documents"
 
-/** iCloud Document Sync helps integrate iCloud into iOS (OS X coming soon) Objective-C document projects with one-line code methods. Sync, upload, manage, and remove documents to and from iCloud with only a few lines of code (compared to the hundreds of lines and hours that it usually takes). Updates and more details on this project can be found on [GitHub](http://www.github.com/iRareMedia/iCloudDocumentSync). If you like the project, please [star it](https://github.com/iRareMedia/iCloudDocumentSync) on GitHub!
+
+/** iCloud Document Sync makes it easy for developers to integrate the iCloud document storage APIs into iOS applications. This is how iCloud document-storage and management should've been out of the box from Apple. Integrate iCloud into iOS (OS X coming soon) Objective-C document projects with one-line code methods. Sync, upload, manage, and remove documents to and from iCloud with only a few lines of code (compared to the hundreds of lines and hours that it usually takes). Get iCloud up and running in your iOS app in only a few minutes. Updates and more details on this project can be found on [GitHub](http://www.github.com/iRareMedia/iCloudDocumentSync). If you like the project, please star it on GitHub!
  
  The `iCloud` class provides methods to integrate iCloud into document projects.
  
@@ -22,8 +45,9 @@
  3. Subscribe to the `<iCloudDelegate>` delegate.
  4. Call the following methods to setup iCloud when your app starts:
  
-        iCloud *cloud = [[iCloud sharedCloud] init]; // This will help to begin the sync process and register for document updates.
-        [cloud setDelegate:self]; // Set this if you plan to use the delegate
+    [[iCloud sharedCloud] setDelegate:self]; // Set this if you plan to use the delegate
+    [[iCloud sharedCloud] setVerboseLogging:YES]; // We want detailed feedback about what's going on with iCloud, this is OFF by default
+    [[iCloud sharedCloud] updateFiles]; // Force iCloud Update: This is done automatically when changes are made, but we want to make sure the view is always updated when presented
  
  
  @warning Only available on iOS 5.1 and later on apps with valid code signing and entitlements. Requires Xcode 5.0.1 and later. Check the online documentation for more information on setting up iCloud in your app. */

+ 160 - 146
iCloud/iCloud.m

@@ -2,7 +2,7 @@
 //  iCloud.m
 //  iCloud Document Sync
 //
-//  Created by iRare Media. Last updated November 2013.
+//  Created by iRare Media. Last updated January 2014.
 //  Available on GitHub. Licensed under MIT with Attribution.
 //
 
@@ -15,14 +15,19 @@
     NSString *fileExtension;
     NSURL *ubiquityContainer;
 }
+
+/// Setup and start the metadata query and related notifications
 - (void)enumerateCloudDocuments;
+
+/// Called by the NSMetadataQuery notifications to updateFiles
 - (void)startUpdate:(NSMetadataQuery *)notification;
+
+/// Perform a quick a straightforward iCloud check without logging - for internal use
 - (BOOL)quickCloudCheck;
+
 @end
 
 @implementation iCloud
-@synthesize query, previousQueryResults, fileList;
-@synthesize delegate, verboseLogging, verboseAvailabilityLogging;
 
 //---------------------------------------------------------------------------------------------------------------------------------------------//
 //------------ Setup --------------------------------------------------------------------------------------------------------------------------//
@@ -42,7 +47,7 @@
     // Setup Starter Sync
     self = [super init];
 	
-	NSLog(@"cloud init ...");
+	NSLog(@"[iCloud] Beginning Initialization");
 	
     if (self) {
         // Setup the File Manager
@@ -52,16 +57,13 @@
         if (notificationCenter == nil) notificationCenter = [NSNotificationCenter defaultCenter];
         
         // Initialize file lists, results, and queries
-        if (fileList == nil) fileList = [NSMutableArray array];
-        if (previousQueryResults == nil) previousQueryResults = [NSMutableArray array];
-        if (query == nil) query = [[NSMetadataQuery alloc] init];
-        
-        // Log the setup
-        NSLog(@"[iCloud] Initialized");
+        if (_fileList == nil) _fileList = [NSMutableArray array];
+        if (_previousQueryResults == nil) _previousQueryResults = [NSMutableArray array];
+        if (_query == nil) _query = [[NSMetadataQuery alloc] init];
         
         // Check the iCloud Ubiquity Container
         dispatch_async (dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) {
-			ubiquityContainer = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier: nil];
+			ubiquityContainer = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];
 			if (ubiquityContainer != nil) {
 				// We can write to the ubiquity container
 				
@@ -77,14 +79,20 @@
 					// Subscribe to changes in iCloud availability (should run on main thread)
 					[notificationCenter addObserver:self selector:@selector(checkCloudAvailability) name:NSUbiquityIdentityDidChangeNotification object:nil];
 					
-					if ([delegate respondsToSelector:@selector(iCloudDidFinishInitializingWitUbiquityToken: withUbiquityContainer:)])
-						[delegate iCloudDidFinishInitializingWitUbiquityToken:cloudToken withUbiquityContainer:ubiquityContainer];
+					if ([_delegate respondsToSelector:@selector(iCloudDidFinishInitializingWitUbiquityToken: withUbiquityContainer:)])
+						[_delegate iCloudDidFinishInitializingWitUbiquityToken:cloudToken withUbiquityContainer:ubiquityContainer];
 				});
+                
+                // Log the setup
+                NSLog(@"[iCloud] Ubiquity Container created and ready");
 			}
 		});
 		
     }
     
+    // Log the setup
+    NSLog(@"[iCloud] Initialized");
+    
     return self;
 }
 
@@ -96,20 +104,20 @@
 - (BOOL)checkCloudAvailability {
     id cloudToken = [fileManager ubiquityIdentityToken];
     if (cloudToken) {
-        if (verboseAvailabilityLogging == YES) NSLog(@"iCloud is available. Ubiquity URL: %@\nUbiquity Token: %@", ubiquityContainer, cloudToken);
+        if (self.verboseAvailabilityLogging == YES) NSLog(@"iCloud is available. Ubiquity URL: %@\nUbiquity Token: %@", ubiquityContainer, cloudToken);
         
-        if ([delegate respondsToSelector:@selector(iCloudAvailabilityDidChangeToState:withUbiquityToken:withUbiquityContainer:)])
-            [delegate iCloudAvailabilityDidChangeToState:YES withUbiquityToken:cloudToken withUbiquityContainer:ubiquityContainer];
+        if ([self.delegate respondsToSelector:@selector(iCloudAvailabilityDidChangeToState:withUbiquityToken:withUbiquityContainer:)])
+            [self.delegate iCloudAvailabilityDidChangeToState:YES withUbiquityToken:cloudToken withUbiquityContainer:ubiquityContainer];
         
         return YES;
     } else {
-        if (verboseAvailabilityLogging == YES)
+        if (self.verboseAvailabilityLogging == YES)
             NSLog(@"iCloud is not available. iCloud may be unavailable for a number of reasons:\n• The device has not yet been configured with an iCloud account, or the Documents & Data option is disabled\n• Your app, %@, does not have properly configured entitlements\nGo to http://bit.ly/18HkxPp for more information on setting up iCloud", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"]);
         else
             NSLog(@"iCloud unavailable");
         
-        if ([delegate respondsToSelector:@selector(iCloudAvailabilityDidChangeToState:withUbiquityToken:withUbiquityContainer:)])
-            [delegate iCloudAvailabilityDidChangeToState:NO withUbiquityToken:nil withUbiquityContainer:ubiquityContainer];
+        if ([self.delegate respondsToSelector:@selector(iCloudAvailabilityDidChangeToState:withUbiquityToken:withUbiquityContainer:)])
+            [self.delegate iCloudAvailabilityDidChangeToState:NO withUbiquityToken:nil withUbiquityContainer:ubiquityContainer];
         
         return NO;
     }
@@ -123,8 +131,6 @@
 	}
 }
 
-
-
 - (BOOL)quickCloudCheck {
     if ([fileManager ubiquityIdentityToken]) {
         return YES;
@@ -138,31 +144,39 @@
 }
 
 - (NSURL *)ubiquitousDocumentsDirectoryURL {
-	// Use the instance variable here - no need to start the retrieval process again
-    NSURL *documentsDirectory = [ubiquityContainer URLByAppendingPathComponent:DOCUMENT_DIRECTORY];
-    NSError *error;
-    
-    BOOL isDirectory = NO;
-    BOOL isFile = [fileManager fileExistsAtPath:[documentsDirectory path] isDirectory:&isDirectory];
-    
-    if (isFile) {
-        // It exists, check if it's a directory
-        if (isDirectory == YES) {
-            return documentsDirectory;
+    @try {
+        // Use the instance variable here - no need to start the retrieval process again
+        if (ubiquityContainer == nil) ubiquityContainer = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];
+        NSURL *documentsDirectory = [ubiquityContainer URLByAppendingPathComponent:DOCUMENT_DIRECTORY];
+        NSError *error;
+        
+        BOOL isDirectory = NO;
+        BOOL isFile = [fileManager fileExistsAtPath:[documentsDirectory path] isDirectory:&isDirectory];
+        
+        if (isFile) {
+            // It exists, check if it's a directory
+            if (isDirectory == YES) {
+                return documentsDirectory;
+            } else {
+                [fileManager removeItemAtPath:[documentsDirectory path] error:&error];
+                [fileManager createDirectoryAtURL:documentsDirectory withIntermediateDirectories:YES attributes:nil error:&error];
+                return documentsDirectory;
+            }
         } else {
-            [fileManager removeItemAtPath:[documentsDirectory path] error:&error];
             [fileManager createDirectoryAtURL:documentsDirectory withIntermediateDirectories:YES attributes:nil error:&error];
             return documentsDirectory;
         }
-    } else {
-        [fileManager createDirectoryAtURL:documentsDirectory withIntermediateDirectories:YES attributes:nil error:&error];
+        
+        if (error) NSLog(@"[iCloud] POSSIBLY FATAL ERROR - Document directory creation error. This error may be fatal and should be recovered from. If the documents directory is not correctly created, this can cause iCloud to stop functioning properly (including exceptiosn being thrown). Error: %@", error);
+        
+        NSLog(@"Documents URL: %@", documentsDirectory);
         return documentsDirectory;
+        
+    } @catch (NSException *exception) {
+        // This method seems to be a common spot for exceptions. In an effort to reduce crashes here, try / catch code has been added (until the bug is squashed).
+        // The most common exception is on line 141: [NSFileManager createDirectoryAtURL:withIntermediateDirectories:attributes:error:]: URL is nil
+        NSLog(@"[iCloud] Caught fatal exception (see below). Exception in ubiquitousDocumentsDirectoryURL method of the iCloud Framework. You may need to create the Document directory manually. This may be a known issue, but please report it on GitHub anyway.\n%@", exception);
     }
-    
-    if (error) NSLog(@"[iCloud] POSSIBLY FATAL ERROR - Document directory creation error. This error may be fatal and should be recovered from. If the documents directory is not correctly created, this can cause iCloud to stop functioning properly (including exceptiosn being thrown). Error: %@", error);
-    
-    NSLog(@"Documents URL: %@", documentsDirectory);
-    return documentsDirectory;
 }
 
 //---------------------------------------------------------------------------------------------------------------------------------------------//
@@ -175,8 +189,8 @@
     NSLog(@"[iCloud] Creating metadata query and notifications");
     
     // Request information from the delegate
-    if ([delegate respondsToSelector:@selector(iCloudQueryLimitedToFileExtension)]) {
-        NSString *fileExt = [delegate iCloudQueryLimitedToFileExtension];
+    if ([self.delegate respondsToSelector:@selector(iCloudQueryLimitedToFileExtension)]) {
+        NSString *fileExt = [self.delegate iCloudQueryLimitedToFileExtension];
         if (fileExt != nil || ![fileExt isEqualToString:@""]) fileExtension = fileExt;
         else fileExtension = @"*";
         
@@ -187,15 +201,15 @@
     }
     
     // Setup iCloud Metadata Query
-	[query setSearchScopes:@[NSMetadataQueryUbiquitousDocumentsScope]];
-	[query setPredicate:[NSPredicate predicateWithFormat:[NSString stringWithFormat:@"%%K.pathExtension LIKE '%@'", fileExtension], NSMetadataItemFSNameKey]];
+	[self.query setSearchScopes:@[NSMetadataQueryUbiquitousDocumentsScope]];
+	[self.query setPredicate:[NSPredicate predicateWithFormat:[NSString stringWithFormat:@"%%K.pathExtension LIKE '%@'", fileExtension], NSMetadataItemFSNameKey]];
     
 	// Pull a list of all the documents in the cloud
-	[notificationCenter addObserver:self selector:@selector(startUpdate:) name:NSMetadataQueryDidFinishGatheringNotification object:query];
-	[notificationCenter addObserver:self selector:@selector(startUpdate:) name:NSMetadataQueryDidUpdateNotification object:query];
+	[notificationCenter addObserver:self selector:@selector(startUpdate:) name:NSMetadataQueryDidFinishGatheringNotification object:self.query];
+	[notificationCenter addObserver:self selector:@selector(startUpdate:) name:NSMetadataQueryDidUpdateNotification object:self.query];
     
     // Start the query
-    BOOL startedQuery = [query startQuery];
+    BOOL startedQuery = [self.query startQuery];
     if (!startedQuery) {
         NSLog(@"[iCloud] Failed to start query.");
         return;
@@ -211,7 +225,7 @@
 
 - (void)updateFiles {
     // Log file update
-    if (verboseLogging == YES) NSLog(@"[iCloud] Beginning file update with NSMetadataQuery");
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Beginning file update with NSMetadataQuery");
     
     // Check for iCloud
     if ([self quickCloudCheck] == NO) return;
@@ -219,13 +233,13 @@
     // Create and Update the list of files on the background thread
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0ul), ^{
         // Disable updates to iCloud while we update to avoid errors
-        [query disableUpdates];
+        [self.query disableUpdates];
         
         NSMutableArray *discoveredFiles = [NSMutableArray array];
         
         // The query reports all files found, every time
-        NSArray *queryResults = query.results;
-        NSLog(@"Query Results: %@", query.results);
+        NSArray *queryResults = self.query.results;
+        NSLog(@"Query Results: %@", self.query.results);
         for (NSMetadataItem *result in queryResults) {
             NSURL *fileURL = [result valueForAttribute:NSMetadataItemURLKey];
             NSNumber *aBool = nil;
@@ -238,21 +252,21 @@
         
         // Get file names in from the query
         NSMutableArray *names = [NSMutableArray array];
-        for (NSMetadataItem *item in query.results) {
+        for (NSMetadataItem *item in self.query.results) {
             [names addObject:[item valueForAttribute:NSMetadataItemFSNameKey]];
         }
         
         // Log query completion
-        if (verboseLogging == YES) NSLog(@"[iCloud] Finished file update with NSMetadataQuery");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Finished file update with NSMetadataQuery");
         
         // Notify the delegate of the results on the main thread
         dispatch_async(dispatch_get_main_queue(), ^{
-            if ([delegate respondsToSelector:@selector(iCloudFilesDidChange:withNewFileNames:)])
-                [delegate iCloudFilesDidChange:discoveredFiles withNewFileNames:names];
+            if ([self.delegate respondsToSelector:@selector(iCloudFilesDidChange:withNewFileNames:)])
+                [self.delegate iCloudFilesDidChange:discoveredFiles withNewFileNames:names];
         });
         
         // Reenable Updates
-        [query enableUpdates];
+        [self.query enableUpdates];
     });
 }
 
@@ -263,7 +277,7 @@
 
 - (void)saveAndCloseDocumentWithName:(NSString *)documentName withContent:(NSData *)content completion:(void (^)(UIDocument *cloudDocument, NSData *documentData, NSError *error))handler {
     // Log save
-    if (verboseLogging == YES) NSLog(@"[iCloud] Beginning document save");
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Beginning document save");
     
     // Check for iCloud
     if ([self quickCloudCheck] == NO) return;
@@ -271,7 +285,7 @@
     // Check for nil / null document name
     if (documentName == nil || [documentName isEqualToString:@""]) {
         // Log error
-        if (verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
         NSError *error = [NSError errorWithDomain:@"The specified document name was empty / blank and could not be saved. Specify a document name next time." code:001 userInfo:nil];
         
         handler(nil, nil, error);
@@ -290,7 +304,7 @@
     if ([fileManager fileExistsAtPath:[fileURL path]]) {
 		// The document did not exist and is being saved for the first time.
 		
-        if (verboseLogging == YES) NSLog(@"[iCloud] Document exists; overwriting, saving and closing");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Document exists; overwriting, saving and closing");
         // Save and create the new document, then close it
         [document saveToURL:document.fileURL forSaveOperation:UIDocumentSaveForOverwriting completionHandler:^(BOOL success) {
             if (success) {
@@ -298,7 +312,7 @@
 				[document closeWithCompletionHandler:^(BOOL success) {
 					if (success) {
 						// Log
-						if (verboseLogging == YES) NSLog(@"[iCloud] Written, saved and closed document");
+						if (self.verboseLogging == YES) NSLog(@"[iCloud] Written, saved and closed document");
 						
 						handler(document, document.contents, nil);
 					} else {
@@ -317,7 +331,7 @@
             }
 		}];
     } else {
-        if (verboseLogging == YES) NSLog(@"[iCloud] Document is new; creating, saving and then closing");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Document is new; creating, saving and then closing");
         
         // The document is being saved by overwriting the current version, then closed.
         [document saveToURL:document.fileURL forSaveOperation:UIDocumentSaveForCreating completionHandler:^(BOOL success) {
@@ -326,7 +340,7 @@
                 [document closeWithCompletionHandler:^(BOOL success) {
                     if (success) {
                         // Log the save and close
-                        if (verboseLogging == YES) NSLog(@"[iCloud] New document created, saved and closed successfully");
+                        if (self.verboseLogging == YES) NSLog(@"[iCloud] New document created, saved and closed successfully");
                         
                         handler(document, document.contents, nil);
                     } else {
@@ -350,7 +364,7 @@
 
 - (void)uploadLocalOfflineDocumentsWithRepeatingHandler:(void (^)(NSString *documentName, NSError *error))repeatingHandler completion:(void (^)(void))completion {
     // Log upload
-    if (verboseLogging == YES) NSLog(@"[iCloud] Beginning local file upload to iCloud. This process may take a long time.");
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Beginning local file upload to iCloud. This process may take a long time.");
     
     // Check for iCloud
     if ([self quickCloudCheck] == NO) return;
@@ -362,7 +376,7 @@
         NSArray *localDocuments = [fileManager contentsOfDirectoryAtPath:documentsDirectory error:nil];
         
         // Log local files
-        if (verboseLogging == YES) NSLog(@"[iCloud] Files stored locally available for uploading: %@", localDocuments);
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Files stored locally available for uploading: %@", localDocuments);
         
         // Compare the arrays then upload documents not already existent in iCloud
         for (int item = 0; item < [localDocuments count]; item++) {
@@ -371,9 +385,9 @@
             if (![[localDocuments objectAtIndex:item] hasPrefix:@"."]) {
                 
                 // If the file does not exist in iCloud, upload it
-                if (![previousQueryResults containsObject:[localDocuments objectAtIndex:item]]) {
+                if (![self.previousQueryResults containsObject:[localDocuments objectAtIndex:item]]) {
                     // Log
-                    if (verboseLogging == YES) NSLog(@"[iCloud] Uploading %@ to iCloud (%i out of %lu)", [localDocuments objectAtIndex:item], item, (unsigned long)[localDocuments count]);
+                    if (self.verboseLogging == YES) NSLog(@"[iCloud] Uploading %@ to iCloud (%i out of %lu)", [localDocuments objectAtIndex:item], item, (unsigned long)[localDocuments count]);
                     
                     // Move the file to iCloud
                     NSURL *cloudURL = [[self ubiquitousDocumentsDirectoryURL] URLByAppendingPathComponent:[localDocuments objectAtIndex:item]];
@@ -396,7 +410,7 @@
                     // Check if the local document is newer than the cloud document
                     
                     // Log conflict
-                    if (verboseLogging == YES) NSLog(@"[iCloud] Conflict between local file and remote file, attempting to automatically resolve");
+                    if (self.verboseLogging == YES) NSLog(@"[iCloud] Conflict between local file and remote file, attempting to automatically resolve");
                     
                     // Get the file URL for the iCloud document
                     NSURL *cloudFileURL = [[self ubiquitousDocumentsDirectoryURL] URLByAppendingPathComponent:[localDocuments objectAtIndex:item]];
@@ -454,13 +468,13 @@
                             NSDictionary *localFile = [[NSDictionary alloc] initWithObjects:@[localFileData, localFileURL, localModDate]
                                                                                     forKeys:@[@"fileContents", @"fileURL", @"modifiedDate"]];;
                             
-                            if ([delegate respondsToSelector:@selector(iCloudFileUploadConflictWithCloudFile:andLocalFile:)]) {
-                                [delegate iCloudFileConflictBetweenCloudFile:cloudFile andLocalFile:localFile];
-                            } else if ([delegate respondsToSelector:@selector(iCloudFileUploadConflictWithCloudFile:andLocalFile:)]) {
+                            if ([self.delegate respondsToSelector:@selector(iCloudFileUploadConflictWithCloudFile:andLocalFile:)]) {
+                                [self.delegate iCloudFileConflictBetweenCloudFile:cloudFile andLocalFile:localFile];
+                            } else if ([self.delegate respondsToSelector:@selector(iCloudFileUploadConflictWithCloudFile:andLocalFile:)]) {
                                 NSLog(@"[iCloud] WARNING: iCloudFileUploadConflictWithCloudFile:andLocalFile is deprecated and will become unavailable in a future version. Use iCloudFileConflictBetweenCloudFile:andLocalFile instead.");
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
-                                [delegate iCloudFileUploadConflictWithCloudFile:cloudFile andLocalFile:localFile];
+                                [self.delegate iCloudFileUploadConflictWithCloudFile:cloudFile andLocalFile:localFile];
 #pragma clang diagnostic pop
                             }
                         }
@@ -476,7 +490,7 @@
         }
         
         // Log completion
-        if (verboseLogging == YES) NSLog(@"[iCloud] Finished uploading all local files to iCloud");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Finished uploading all local files to iCloud");
         
         dispatch_async(dispatch_get_main_queue(), ^{
             if (completion)
@@ -487,7 +501,7 @@
 
 - (void)uploadLocalDocumentToCloudWithName:(NSString *)documentName completion:(void (^)(NSError *error))handler {
     // Log download
-    if (verboseLogging == YES) NSLog(@"[iCloud] Attempting to upload document, %@", documentName);
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Attempting to upload document, %@", documentName);
     
     // Check for iCloud
     if ([self quickCloudCheck] == NO) return;
@@ -495,7 +509,7 @@
     // Check for nil / null document name
     if (documentName == nil || [documentName isEqualToString:@""]) {
         // Log error
-        if (verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
         NSError *error = [NSError errorWithDomain:@"The specified document name was empty / blank and could not be saved. Specify a document name next time." code:001 userInfo:nil];
         
         handler(error);
@@ -510,9 +524,9 @@
         NSString *localDocument = [documentsDirectory stringByAppendingPathComponent:documentName];
         
         // If the file does not exist in iCloud, upload it
-        if (![previousQueryResults containsObject:localDocument]) {
+        if (![self.previousQueryResults containsObject:localDocument]) {
             // Log
-            if (verboseLogging == YES) NSLog(@"[iCloud] Uploading %@ to iCloud", localDocument);
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] Uploading %@ to iCloud", localDocument);
             
             // Move the file to iCloud
             NSURL *cloudURL = [[self ubiquitousDocumentsDirectoryURL] URLByAppendingPathComponent:documentName];
@@ -537,7 +551,7 @@
             // Check if the local document is newer than the cloud document
             
             // Log conflict
-            if (verboseLogging == YES) NSLog(@"[iCloud] Conflict between local file and remote file, attempting to automatically resolve");
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] Conflict between local file and remote file, attempting to automatically resolve");
             
             // Get the file URL for the documents
             NSURL *cloudURL = [[self ubiquitousDocumentsDirectoryURL] URLByAppendingPathComponent:documentName];
@@ -599,13 +613,13 @@
                     NSDictionary *localFile = [[NSDictionary alloc] initWithObjects:@[localFileData, localURL, localModDate]
                                                                             forKeys:@[@"fileContents", @"fileURL", @"modifiedDate"]];;
                     
-                    if ([delegate respondsToSelector:@selector(iCloudFileUploadConflictWithCloudFile:andLocalFile:)]) {
-                        [delegate iCloudFileConflictBetweenCloudFile:cloudFile andLocalFile:localFile];
-                    } else if ([delegate respondsToSelector:@selector(iCloudFileUploadConflictWithCloudFile:andLocalFile:)]) {
+                    if ([self.delegate respondsToSelector:@selector(iCloudFileUploadConflictWithCloudFile:andLocalFile:)]) {
+                        [self.delegate iCloudFileConflictBetweenCloudFile:cloudFile andLocalFile:localFile];
+                    } else if ([self.delegate respondsToSelector:@selector(iCloudFileUploadConflictWithCloudFile:andLocalFile:)]) {
                         NSLog(@"[iCloud] WARNING: iCloudFileUploadConflictWithCloudFile:andLocalFile is deprecated and will become unavailable in a future version. Use iCloudFileConflictBetweenCloudFile:andLocalFile instead.");
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
-                        [delegate iCloudFileUploadConflictWithCloudFile:cloudFile andLocalFile:localFile];
+                        [self.delegate iCloudFileUploadConflictWithCloudFile:cloudFile andLocalFile:localFile];
 #pragma clang diagnostic pop
                     }
                     
@@ -615,7 +629,7 @@
         }
         
         // Log completion
-        if (verboseLogging == YES) NSLog(@"[iCloud] Finished uploading local file to iCloud");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Finished uploading local file to iCloud");
         
         dispatch_async(dispatch_get_main_queue(), ^{
             handler(nil);
@@ -631,7 +645,7 @@
 
 - (void)retrieveCloudDocumentWithName:(NSString *)documentName completion:(void (^)(UIDocument *cloudDocument, NSData *documentData, NSError *error))handler {
     // Log Retrieval
-    if (verboseLogging == YES) NSLog(@"[iCloud] Retrieving iCloud document, %@", documentName);
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Retrieving iCloud document, %@", documentName);
     
     // Check for iCloud availability
     if ([self quickCloudCheck] == NO) return;
@@ -639,7 +653,7 @@
     // Check for nil / null document name
     if (documentName == nil || [documentName isEqualToString:@""]) {
         // Log error
-        if (verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
         NSError *error = [NSError errorWithDomain:@"The specified document name was empty / blank and could not be saved. Specify a document name next time." code:001 userInfo:nil];
         
         handler(nil, nil, error);
@@ -654,18 +668,18 @@
         // If the file exists open it; otherwise, create it
         if ([fileManager fileExistsAtPath:[fileURL path]]) {
             // Log opening
-            if (verboseLogging == YES) NSLog(@"[iCloud] The document, %@, already exists and will be opened", documentName);
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] The document, %@, already exists and will be opened", documentName);
             
             // Create the UIDocument object from the URL
             iCloudDocument *document = [[iCloudDocument alloc] initWithFileURL:fileURL];
             
             if (document.documentState & UIDocumentStateClosed) {
-                if (verboseLogging == YES) NSLog(@"[iCloud] Document is closed and will be opened");
+                if (self.verboseLogging == YES) NSLog(@"[iCloud] Document is closed and will be opened");
                 
                 [document openWithCompletionHandler:^(BOOL success){
                     if (success) {
                         // Log open
-                        if (verboseLogging == YES) NSLog(@"[iCloud] Opened document");
+                        if (self.verboseLogging == YES) NSLog(@"[iCloud] Opened document");
                         
                         // Pass data on to the completion handler on the main thread
                         dispatch_async(dispatch_get_main_queue(), ^{
@@ -687,7 +701,7 @@
                 }];
             } else if (document.documentState & UIDocumentStateNormal) {
                 // Log open
-                if (verboseLogging == YES) NSLog(@"[iCloud] Document already opened, retrieving content");
+                if (self.verboseLogging == YES) NSLog(@"[iCloud] Document already opened, retrieving content");
                 
                 // Pass data on to the completion handler on the main thread
                 dispatch_async(dispatch_get_main_queue(), ^{
@@ -697,7 +711,7 @@
                 return;
             } else if (document.documentState & UIDocumentStateInConflict) {
                 // Log open
-                if (verboseLogging == YES) NSLog(@"[iCloud] Document in conflict. The document may not contain correct data. An error will be returned along with the other parameters in the completion handler.");
+                if (self.verboseLogging == YES) NSLog(@"[iCloud] Document in conflict. The document may not contain correct data. An error will be returned along with the other parameters in the completion handler.");
                 
                 // Create Error
                 NSLog(@"[iCloud] Error while retrieving document, %@, because the document is in conflict", documentName);
@@ -711,7 +725,7 @@
                 return;
             } else if (document.documentState & UIDocumentStateEditingDisabled) {
                 // Log open
-                if (verboseLogging == YES) NSLog(@"[iCloud] Document editing disabled. The document is not currently editable, use the documentStateForFile: method to determine when the document is available again. The document and its contents will still be passed as parameters in the completion handler.");
+                if (self.verboseLogging == YES) NSLog(@"[iCloud] Document editing disabled. The document is not currently editable, use the documentStateForFile: method to determine when the document is available again. The document and its contents will still be passed as parameters in the completion handler.");
                 
                 // Pass data on to the completion handler on the main thread
                 dispatch_async(dispatch_get_main_queue(), ^{
@@ -723,7 +737,7 @@
             
         } else {
             // Log creation
-            if (verboseLogging == YES) NSLog(@"[iCloud] The document, %@, does not exist and will be created as an empty document", documentName);
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] The document, %@, does not exist and will be created as an empty document", documentName);
             
             // Create the UIDocument
             iCloudDocument *document = [[iCloudDocument alloc] initWithFileURL:fileURL];
@@ -732,7 +746,7 @@
             // Save the new document to disk
             [document saveToURL:fileURL forSaveOperation:UIDocumentSaveForCreating completionHandler:^(BOOL success) {
                 // Log save
-                if (verboseLogging == YES) NSLog(@"[iCloud] Saved and opened the document");
+                if (self.verboseLogging == YES) NSLog(@"[iCloud] Saved and opened the document");
                 
                 dispatch_async(dispatch_get_main_queue(), ^{
                     handler(document, document.contents, nil);
@@ -746,7 +760,7 @@
 
 - (iCloudDocument *)retrieveCloudDocumentObjectWithName:(NSString *)documentName {
     // Log Retrieval
-    if (verboseLogging == YES) NSLog(@"[iCloud] Retrieving iCloudDocument object with name: %@", documentName);
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Retrieving iCloudDocument object with name: %@", documentName);
     
     // Check for iCloud availability
     if ([self quickCloudCheck] == NO) return nil;
@@ -754,7 +768,7 @@
     // Check for nil / null document name
     if (documentName == nil || [documentName isEqualToString:@""]) {
         // Log error
-        if (verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
         return nil;
     }
     
@@ -766,9 +780,9 @@
         iCloudDocument *document = [[iCloudDocument alloc] initWithFileURL:fileURL];
         
         if ([fileManager fileExistsAtPath:[fileURL path]]) {
-            if (verboseLogging == YES) NSLog(@"[iCloud] The document, %@, exists and will be returned as an iCloudDocument object", documentName);
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] The document, %@, exists and will be returned as an iCloudDocument object", documentName);
         } else {
-            if (verboseLogging == YES) NSLog(@"[iCloud] The document, %@, does not exist but will be returned as an empty iCloudDocument object", documentName);
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] The document, %@, does not exist but will be returned as an empty iCloudDocument object", documentName);
         }
         
         // Return the iCloudDocument object
@@ -854,7 +868,7 @@
 
 - (NSArray *)getListOfCloudFiles {
     // Log retrieval
-    if (verboseLogging == YES) NSLog(@"[iCloud] Getting list of iCloud documents");
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Getting list of iCloud documents");
     
     // Check for iCloud
     if ([self quickCloudCheck] == NO) return nil;
@@ -863,7 +877,7 @@
     NSArray *directoryContent = [fileManager contentsOfDirectoryAtURL:[self ubiquitousDocumentsDirectoryURL] includingPropertiesForKeys:nil options:0 error:nil];
     
     // Log retrieval
-    if (verboseLogging == YES) NSLog(@"[iCloud] Retrieved list of iCloud documents");
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Retrieved list of iCloud documents");
     
     // Return the list of files
     return directoryContent;
@@ -881,7 +895,7 @@
     // Check for nil / null document name
     if (documentName == nil || [documentName isEqualToString:@""]) {
         // Log error
-        if (verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
         NSError *error = [NSError errorWithDomain:@"The specified document name was empty / blank and could not be saved. Specify a document name next time." code:001 userInfo:nil];
         
         handler(nil, nil, error);
@@ -910,7 +924,7 @@
 
 - (BOOL)monitorDocumentStateForFile:(NSString *)documentName onTarget:(id)sender withSelector:(SEL)selector {
     // Log monitoring
-    if (verboseLogging == YES) NSLog(@"[iCloud] Preparing to monitor for changes to %@", documentName);
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Preparing to monitor for changes to %@", documentName);
     
     // Check for iCloud
     if ([self quickCloudCheck] == NO) return NO;
@@ -918,12 +932,12 @@
     // Check for nil / null document name
     if (documentName == nil || [documentName isEqualToString:@""]) {
         // Log error
-        if (verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
         return NO;
     }
     
     // Log monitoring
-    if (verboseLogging == YES) NSLog(@"[iCloud] Checking for existance of %@", documentName);
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Checking for existance of %@", documentName);
     
     @try {
         // Get the URL to get the file from
@@ -937,7 +951,7 @@
             [notificationCenter addObserver:sender selector:selector name:UIDocumentStateChangedNotification object:document];
             
             // Log monitoring
-            if (verboseLogging == YES) NSLog(@"[iCloud] Now successfully monitoring for changes to %@ on %@", documentName, sender);
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] Now successfully monitoring for changes to %@ on %@", documentName, sender);
             
             return YES;
         } else {
@@ -956,7 +970,7 @@
 
 - (BOOL)stopMonitoringDocumentStateChangesForFile:(NSString *)documentName onTarget:(id)sender {
     // Log monitoring
-    if (verboseLogging == YES) NSLog(@"[iCloud] Preparing to stop monitoring document changes to %@", documentName);
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Preparing to stop monitoring document changes to %@", documentName);
     
     // Check for iCloud
     if ([self quickCloudCheck] == NO) return NO;
@@ -964,12 +978,12 @@
     // Check for nil / null document name
     if (documentName == nil || [documentName isEqualToString:@""]) {
         // Log error
-        if (verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
         return NO;
     }
     
     // Log monitoring
-    if (verboseLogging == YES) NSLog(@"[iCloud] Checking for existance of %@", documentName);
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Checking for existance of %@", documentName);
     
     @try {
         // Get the URL to get the file from
@@ -984,7 +998,7 @@
             [notificationCenter removeObserver:sender name:UIDocumentStateChangedNotification object:document];
             
             // Log monitoring
-            if (verboseLogging == YES) NSLog(@"[iCloud] Stopped monitoring document state changes to %@", documentName);
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] Stopped monitoring document state changes to %@", documentName);
             
             return YES;
         } else {
@@ -1008,7 +1022,7 @@
 
 - (NSArray *)findUnresolvedConflictingVersionsOfFile:(NSString *)documentName {
     // Log conflict search
-    if (verboseLogging == YES) NSLog(@"[iCloud] Preparing to find all version conflicts for %@", documentName);
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Preparing to find all version conflicts for %@", documentName);
     
     // Check for iCloud
     if ([self quickCloudCheck] == NO) return nil;
@@ -1016,12 +1030,12 @@
     // Check for nil / null document name
     if (documentName == nil || [documentName isEqualToString:@""]) {
         // Log error
-        if (verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
         return nil;
     }
     
     // Log conflict search
-    if (verboseLogging == YES) NSLog(@"[iCloud] Checking for existance of %@", documentName);
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Checking for existance of %@", documentName);
     
     @try {
         // Get the URL to get the file from
@@ -1031,7 +1045,7 @@
         // Check if the file exists, and return
         if ([fileManager fileExistsAtPath:[fileURL path]]) {
             // Log conflict search
-            if (verboseLogging == YES) NSLog(@"[iCloud] %@ exists at the correct path, proceeding to find the conflicts", documentName);
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] %@ exists at the correct path, proceeding to find the conflicts", documentName);
         
             NSMutableArray *fileVersions = [NSMutableArray array];
             
@@ -1058,7 +1072,7 @@
 
 - (void)resolveConflictForFile:(NSString *)documentName withSelectedFileVersion:(NSFileVersion *)documentVersion {
     // Log resolution
-    if (verboseLogging == YES) NSLog(@"[iCloud] Preparing to resolve version conflict for %@", documentName);
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Preparing to resolve version conflict for %@", documentName);
     
     // Check for iCloud
     if ([self quickCloudCheck] == NO) return;
@@ -1066,12 +1080,12 @@
     // Check for nil / null document name
     if (documentName == nil || [documentName isEqualToString:@""]) {
         // Log error
-        if (verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
         return;
     }
     
     // Log resolution
-    if (verboseLogging == YES) NSLog(@"[iCloud] Checking for existance of %@", documentName);
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Checking for existance of %@", documentName);
     
     @try {
         // Get the URL to get the file from
@@ -1081,12 +1095,12 @@
         // Check if the file exists, and return
         if ([fileManager fileExistsAtPath:[fileURL path]]) {
             // Log resolution
-            if (verboseLogging == YES) NSLog(@"[iCloud] %@ exists at the correct path, proceeding to resolve the conflict", documentName);
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] %@ exists at the correct path, proceeding to resolve the conflict", documentName);
             
             // Make the current version "win" the conflict if it is selected
             if (![documentVersion isEqual:[NSFileVersion currentVersionOfItemAtURL:fileURL]]) {
                 // Log resolution
-                if (verboseLogging == YES) NSLog(@"[iCloud] The current version (%@) of %@ matches the selected version. Resolving conflict...", documentVersion, documentName);
+                if (self.verboseLogging == YES) NSLog(@"[iCloud] The current version (%@) of %@ matches the selected version. Resolving conflict...", documentVersion, documentName);
                 
                 [documentVersion replaceItemAtURL:fileURL options:0 error:nil];
             }
@@ -1095,7 +1109,7 @@
             [NSFileVersion removeOtherVersionsOfItemAtURL:fileURL error:nil];
             
             // Log resolution
-            if (verboseLogging == YES) NSLog(@"[iCloud] Removing all unresolved other versions of %@", documentName);
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] Removing all unresolved other versions of %@", documentName);
             
             NSArray *conflictVersions = [NSFileVersion unresolvedConflictVersionsOfItemAtURL:fileURL];
             for (NSFileVersion *fileVersion in conflictVersions) {
@@ -1103,7 +1117,7 @@
             }
             
             // Log resolution
-            if (verboseLogging == YES) NSLog(@"[iCloud] Finished resolving conflicts for %@", documentName);
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] Finished resolving conflicts for %@", documentName);
         } else {
             // The document could not be found
             NSLog(@"[iCloud] File not found: %@", documentName);
@@ -1125,7 +1139,7 @@
 
 - (NSURL *)shareDocumentWithName:(NSString *)documentName completion:(void (^)(NSURL *sharedURL, NSDate *expirationDate, NSError *error))handler {
     // Log share
-    if (verboseLogging == YES) NSLog(@"[iCloud] Attempting to share document");
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Attempting to share document");
     
     // Check for iCloud
     if ([self quickCloudCheck] == NO) return nil;
@@ -1133,7 +1147,7 @@
     // Check for nil / null document name
     if (documentName == nil || [documentName isEqualToString:@""]) {
         // Log error
-        if (verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
         return nil;
     }
     
@@ -1144,7 +1158,7 @@
         // Check that the file exists
         if ([fileManager fileExistsAtPath:[fileURL path]]) {
             // Log share
-            if (verboseLogging == YES) NSLog(@"[iCloud] File exists, preparing to share it");
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] File exists, preparing to share it");
             
             // Create the URL to be returned outside of the block
             __block NSURL *url;
@@ -1159,7 +1173,7 @@
                 url = [fileManager URLForPublishingUbiquitousItemAtURL:fileURL expirationDate:&date error:&error];
                 
                 // Log share
-                if (verboseLogging == YES) NSLog(@"[iCloud] Shared iCloud document");
+                if (self.verboseLogging == YES) NSLog(@"[iCloud] Shared iCloud document");
                 
                 dispatch_async(dispatch_get_main_queue(), ^{
                     // Pass the data to the handler
@@ -1190,7 +1204,7 @@
 
 - (void)deleteDocumentWithName:(NSString *)documentName completion:(void (^)(NSError *error))handler {
     // Log delete
-    if (verboseLogging == YES) NSLog(@"[iCloud] Attempting to delete document");
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Attempting to delete document");
     
     // Check for iCloud
     if ([self quickCloudCheck] == NO) return;
@@ -1198,7 +1212,7 @@
     // Check for nil / null document name
     if (documentName == nil || [documentName isEqualToString:@""]) {
         // Log error
-        if (verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
         return;
     }
     
@@ -1209,7 +1223,7 @@
         // Check that the file exists
         if ([fileManager fileExistsAtPath:[fileURL path]]) {
             // Log share
-            if (verboseLogging == YES) NSLog(@"[iCloud] File exists, attempting to delete it");
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] File exists, attempting to delete it");
             
             // Move to the background thread for safety
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) {
@@ -1233,7 +1247,7 @@
                         return;
                     } else {
                         // Log success
-                        if (verboseLogging == YES) NSLog(@"[iCloud] The document has been deleted");
+                        if (self.verboseLogging == YES) NSLog(@"[iCloud] The document has been deleted");
                         
                         dispatch_async(dispatch_get_main_queue(), ^{
                             [self updateFiles];
@@ -1263,7 +1277,7 @@
 
 - (void)evictCloudDocumentWithName:(NSString *)documentName completion:(void (^)(NSError *error))handler {
     // Log download
-    if (verboseLogging == YES) NSLog(@"[iCloud] Attempting to evict iCloud document, %@", documentName);
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Attempting to evict iCloud document, %@", documentName);
     
     // Check for iCloud
     if ([self quickCloudCheck] == NO) return;
@@ -1271,7 +1285,7 @@
     // Check for nil / null document name
     if (documentName == nil || [documentName isEqualToString:@""]) {
         // Log error
-        if (verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
         return;
     }
     
@@ -1282,9 +1296,9 @@
         NSString *localDocument = [documentsDirectory stringByAppendingPathComponent:documentName];
         
         // If the file does not exist in iCloud, upload it
-        if (![previousQueryResults containsObject:localDocument]) {
+        if (![self.previousQueryResults containsObject:localDocument]) {
             // Log
-            if (verboseLogging == YES) NSLog(@"[iCloud] Evicting %@ from iCloud", localDocument);
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] Evicting %@ from iCloud", localDocument);
             
             // Move the file to iCloud
             NSURL *cloudURL = [[self ubiquitousDocumentsDirectoryURL] URLByAppendingPathComponent:documentName];
@@ -1309,7 +1323,7 @@
             // Check if the cloud document is newer than the local document
             
             // Log conflict
-            if (verboseLogging == YES) NSLog(@"[iCloud] Conflict between local file and remote file, attempting to automatically resolve");
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] Conflict between local file and remote file, attempting to automatically resolve");
             
             // Get the file URL for the documents
             NSURL *cloudURL = [[self ubiquitousDocumentsDirectoryURL] URLByAppendingPathComponent:documentName];
@@ -1384,13 +1398,13 @@
                     NSDictionary *localFile = [[NSDictionary alloc] initWithObjects:@[localFileData, localURL, localModDate]
                                                                             forKeys:@[@"fileContents", @"fileURL", @"modifiedDate"]];;
                     
-                    if ([delegate respondsToSelector:@selector(iCloudFileUploadConflictWithCloudFile:andLocalFile:)]) {
-                        [delegate iCloudFileConflictBetweenCloudFile:cloudFile andLocalFile:localFile];
-                    } else if ([delegate respondsToSelector:@selector(iCloudFileUploadConflictWithCloudFile:andLocalFile:)]) {
+                    if ([self.delegate respondsToSelector:@selector(iCloudFileUploadConflictWithCloudFile:andLocalFile:)]) {
+                        [self.delegate iCloudFileConflictBetweenCloudFile:cloudFile andLocalFile:localFile];
+                    } else if ([self.delegate respondsToSelector:@selector(iCloudFileUploadConflictWithCloudFile:andLocalFile:)]) {
                         NSLog(@"[iCloud] WARNING: iCloudFileUploadConflictWithCloudFile:andLocalFile is deprecated and will become unavailable in a future version. Use iCloudFileConflictBetweenCloudFile:andLocalFile instead.");
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
-                        [delegate iCloudFileUploadConflictWithCloudFile:cloudFile andLocalFile:localFile];
+                        [self.delegate iCloudFileUploadConflictWithCloudFile:cloudFile andLocalFile:localFile];
 #pragma clang diagnostic pop
                     }
                     
@@ -1400,7 +1414,7 @@
         }
         
         // Log completion
-        if (verboseLogging == YES) NSLog(@"[iCloud] Finished evicting iCloud document. Successfully moved to local storage.");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Finished evicting iCloud document. Successfully moved to local storage.");
         
         dispatch_async(dispatch_get_main_queue(), ^{
             handler(nil);
@@ -1416,7 +1430,7 @@
 
 - (void)renameOriginalDocument:(NSString *)documentName withNewName:(NSString *)newName completion:(void (^)(NSError *error))handler {
     // Log rename
-    if (verboseLogging == YES) NSLog(@"[iCloud] Attempting to rename document, %@, to the new name: %@", documentName, newName);
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Attempting to rename document, %@, to the new name: %@", documentName, newName);
     
     // Check for iCloud
     if ([self quickCloudCheck] == NO) return;
@@ -1424,7 +1438,7 @@
     // Check for nil / null document name
     if (documentName == nil || [documentName isEqualToString:@""] || newName == nil || [newName isEqualToString:@""]) {
         // Log error
-        if (verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
         return;
     }
     
@@ -1459,7 +1473,7 @@
     }
     
     // Log success of existence
-    if (verboseLogging == YES) NSLog(@"[iCloud] Files passed existence check, preparing to rename");
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Files passed existence check, preparing to rename");
     
     // Move to the background thread for safety
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) {
@@ -1471,14 +1485,14 @@
             BOOL moveSuccess;
             
             // Log rename
-            if (verboseLogging == YES) NSLog(@"[iCloud] Renaming Files");
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] Renaming Files");
             
             // Do the actual renaming
             moveSuccess = [fileManager moveItemAtURL:sourceFileURL toURL:newFileURL error:&moveError];
             
             if (moveSuccess) {
                 // Log success
-                if (verboseLogging == YES) NSLog(@"[iCloud] Renamed Files");
+                if (self.verboseLogging == YES) NSLog(@"[iCloud] Renamed Files");
                 
                 dispatch_async(dispatch_get_main_queue(), ^{
                     if (handler)
@@ -1516,7 +1530,7 @@
 
 - (void)duplicateOriginalDocument:(NSString *)documentName withNewName:(NSString *)newName completion:(void (^)(NSError *error))handler {
     // Log duplication
-    if (verboseLogging == YES) NSLog(@"[iCloud] Attempting to duplicate document, %@", documentName);
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Attempting to duplicate document, %@", documentName);
     
     // Check for iCloud
     if ([self quickCloudCheck] == NO) return;
@@ -1524,7 +1538,7 @@
     // Check for nil / null document name
     if (documentName == nil || [documentName isEqualToString:@""] || newName == nil || [newName isEqualToString:@""]) {
         // Log error
-        if (verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Specified document name must not be empty");
         return;
     }
     
@@ -1559,7 +1573,7 @@
     }
     
     // Log success of existence
-    if (verboseLogging == YES) NSLog(@"[iCloud] Files passed existence check, preparing to duplicate");
+    if (self.verboseLogging == YES) NSLog(@"[iCloud] Files passed existence check, preparing to duplicate");
     
     // Move to the background thread for safety
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) {
@@ -1567,14 +1581,14 @@
         BOOL moveSuccess;
         
         // Log duplication
-        if (verboseLogging == YES) NSLog(@"[iCloud] Duplicating Files");
+        if (self.verboseLogging == YES) NSLog(@"[iCloud] Duplicating Files");
         
         // Do the actual duplicating
         moveSuccess = [fileManager copyItemAtURL:sourceFileURL toURL:newFileURL error:&moveError];
         
         if (moveSuccess) {
             // Log success
-            if (verboseLogging == YES) NSLog(@"[iCloud] Duplicated Files");
+            if (self.verboseLogging == YES) NSLog(@"[iCloud] Duplicated Files");
             
             dispatch_async(dispatch_get_main_queue(), ^{
                 if (handler)

+ 10 - 2
iCloud/iCloudDocument.h

@@ -2,11 +2,19 @@
 //  iCloudDocument.h
 //  iCloud Document Sync
 //
-//  Created by iRare Media. Last updated November 2013.
+//  Created by iRare Media. Last updated January 2014.
 //  Available on GitHub. Licensed under MIT with Attribution.
 //
 
-#import <UIKit/UIKit.h>
+// Check for Objective-C Modules
+#if __has_feature(objc_modules)
+    // We recommend enabling Objective-C Modules in your project Build Settings for numerous benefits over regular #imports. Read more from the Modules documentation: http://clang.llvm.org/docs/Modules.html
+    @import Foundation;
+    @import UIKit;
+#else
+    #import <Foundation/Foundation.h>
+    #import <UIKit/UIKit.h>
+#endif
 
 /** Use the iCloudDocument class (a subclass of UIDocument) to read and write documents managed by the iCloud class. You should rarely interact directly with iCloudDocument. The iCloud class manages all interactions with iCloudDocument. You can however retieve an iCloudDocument object by specifying its URL in the iCloud class.
  

+ 1 - 1
iCloud/iCloudDocument.m

@@ -2,7 +2,7 @@
 //  iCloudDocument.m
 //  iCloud Document Sync
 //
-//  Created by iRare Media. Last updated November 2013.
+//  Created by iRare Media. Last updated January 2014.
 //  Available on GitHub. Licensed under MIT with Attribution.
 //