Skip to content

Commit

Permalink
Version 6.4
Browse files Browse the repository at this point in the history
Bug Fixes. Should Fix Issue #14, although the problem may still persist. Submit a pull request if you have a fix.
  • Loading branch information
iRare Media committed Oct 24, 2013
1 parent dcc94f0 commit 881a545
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<key>CFBundleName</key>
<string>iCloudSDK Documentation</string>
<key>CFBundleShortVersionString</key>
<string>6.3</string>
<string>6.4</string>
<key>CFBundleVersion</key>
<string>6.3</string>
<string>6.4</string>



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ <h4 class="method-subtitle">Declared In</h4>
<div id="footer">
<hr />
<div class="footer-copyright">
<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-10-10)</span><br />
<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-10-24)</span><br />

<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 961)</a>.</span></p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ <h4 class="method-subtitle">Declared In</h4>
<div id="footer">
<hr />
<div class="footer-copyright">
<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-10-10)</span><br />
<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-10-24)</span><br />

<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 961)</a>.</span></p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ <h4 class="method-subtitle">Declared In</h4>
<div id="footer">
<hr />
<div class="footer-copyright">
<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-10-10)</span><br />
<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-10-24)</span><br />

<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 961)</a>.</span></p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <h2 class="index-title">Protocol References</h2>
<div id="footer">
<hr />
<div class="footer-copyright">
<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-10-10)</span><br />
<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-10-24)</span><br />

<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 961)</a>.</span></p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h2 class="index-title">Protocol References</h2>
<div id="footer">
<hr />
<div class="footer-copyright">
<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-10-10)</span><br />
<p><span class="copyright">&copy; 2013 iRare Media. All rights reserved. (Last updated: 2013-10-24)</span><br />

<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 961)</a>.</span></p>

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 1 addition & 2 deletions iCloud.framework/Versions/A/Headers/iCloudDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
@property (strong) NSData *contents;

/** Initialize a new UIDocument with the specified file path
@param url The path to the UIDocument file
@return UIDocument object at the specified URL
*/
- (id)initWithFileURL:(NSURL *)url;
Expand Down
Binary file modified iCloud.framework/Versions/A/iCloud
Binary file not shown.
Binary file not shown.
18 changes: 12 additions & 6 deletions iCloud/iCloud.m
Original file line number Diff line number Diff line change
Expand Up @@ -339,16 +339,18 @@ + (void)uploadLocalOfflineDocumentsWithDelegate:(id<iCloudDelegate>)delegate rep

+ (void)retrieveCloudDocumentWithName:(NSString *)documentName completion:(void (^)(UIDocument *cloudDocument, NSData *documentData, NSError *error))handler {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0ul), ^{
// Create the File Manager
NSFileManager *fileManager = [NSFileManager defaultManager];

// Get the URL to get the file from
NSURL *folderURL = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];
NSURL *folderURL = [fileManager URLForUbiquityContainerIdentifier:nil];
NSURL *fileURL = [[folderURL URLByAppendingPathComponent:DOCUMENT_DIRECTORY] URLByAppendingPathComponent:documentName];

// Create the UIDocument object from the URL
iCloudDocument *document = [[iCloudDocument alloc] initWithFileURL:fileURL];

// If the file exists open it; otherwise, create it
NSFileManager *fm = [NSFileManager defaultManager];
if ([fm fileExistsAtPath:[fileURL path]]) {
if ([fileManager fileExistsAtPath:[fileURL path]]) {
// Create the UIDocument object from the URL
iCloudDocument *document = [[iCloudDocument alloc] initWithFileURL:fileURL];

[document openWithCompletionHandler:^(BOOL success){
if (success) {
dispatch_async(dispatch_get_main_queue(), ^{
Expand All @@ -363,6 +365,10 @@ + (void)retrieveCloudDocumentWithName:(NSString *)documentName completion:(void
}
}];
} else {
// Create the UIDocument
iCloudDocument *document = [[iCloudDocument alloc] initWithFileURL:fileURL];
document.contents = [[NSData alloc] init];

// Save the new document to disk
[document saveToURL:fileURL forSaveOperation:UIDocumentSaveForCreating completionHandler:^(BOOL success) {
dispatch_async(dispatch_get_main_queue(), ^{
Expand Down
3 changes: 1 addition & 2 deletions iCloud/iCloudDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
@property (strong) NSData *contents;

/** Initialize a new UIDocument with the specified file path
@param url The path to the UIDocument file
@return UIDocument object at the specified URL
*/
- (id)initWithFileURL:(NSURL *)url;
Expand Down
2 changes: 1 addition & 1 deletion iCloud/iCloudDocument.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ - (void)setDocumentData:(NSData *)newData {

// Register the undo operation
[self.undoManager setActionName:@"Data Change"];
[self.undoManager registerUndoWithTarget:self selector:@selector(setDocumentText:) object:oldData];
[self.undoManager registerUndoWithTarget:self selector:@selector(setDocumentData:) object:oldData];

This comment has been minimized.

Copy link
@Sam-Spencer

Sam-Spencer Oct 24, 2013

Member

Fixes #15

});
}

Expand Down

0 comments on commit 881a545

Please sign in to comment.