diff --git a/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.pbxproj b/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.pbxproj new file mode 100644 index 0000000..be86296 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.pbxproj @@ -0,0 +1,660 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 5B426C4E16DA4C9400054A22 /* MyFileInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B426C4D16DA4C9400054A22 /* MyFileInfo.m */; }; + 5B426C5A16DA758B00054A22 /* MFOCoreDataManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B426C5916DA758B00054A22 /* MFOCoreDataManager.m */; }; + 5B426C6D16DAAA3400054A22 /* MFOFileDetailsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B426C6C16DAAA3400054A22 /* MFOFileDetailsCell.m */; }; + 5B7A969E16D91D7500D9CB51 /* MyFilesOnline.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 5B7A969C16D91D7500D9CB51 /* MyFilesOnline.xcdatamodeld */; }; + 5B7A96A516D91DAB00D9CB51 /* MyDirectoryInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B7A96A016D91DAB00D9CB51 /* MyDirectoryInfo.m */; }; + 5B7A96A716D91DAB00D9CB51 /* MyFileTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B7A96A416D91DAB00D9CB51 /* MyFileTypes.m */; }; + 5BD5C98A16D94B6E00F8E2F8 /* MFOUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BD5C98916D94B6E00F8E2F8 /* MFOUtility.m */; }; + 5BF0A7C616D88DA600E19081 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A7C516D88DA600E19081 /* UIKit.framework */; }; + 5BF0A7C816D88DA600E19081 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A7C716D88DA600E19081 /* Foundation.framework */; }; + 5BF0A7CA16D88DA600E19081 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A7C916D88DA600E19081 /* CoreGraphics.framework */; }; + 5BF0A7CC16D88DA600E19081 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A7CB16D88DA600E19081 /* CoreData.framework */; }; + 5BF0A7D216D88DA600E19081 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5BF0A7D016D88DA600E19081 /* InfoPlist.strings */; }; + 5BF0A7D416D88DA600E19081 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A7D316D88DA600E19081 /* main.m */; }; + 5BF0A7D816D88DA600E19081 /* MFOAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A7D716D88DA600E19081 /* MFOAppDelegate.m */; }; + 5BF0A7DA16D88DA600E19081 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 5BF0A7D916D88DA600E19081 /* Default.png */; }; + 5BF0A7DC16D88DA600E19081 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5BF0A7DB16D88DA600E19081 /* Default@2x.png */; }; + 5BF0A7DE16D88DA600E19081 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5BF0A7DD16D88DA600E19081 /* Default-568h@2x.png */; }; + 5BF0A7F516D88DA700E19081 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A7F416D88DA700E19081 /* SenTestingKit.framework */; }; + 5BF0A7F616D88DA700E19081 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A7C516D88DA600E19081 /* UIKit.framework */; }; + 5BF0A7F716D88DA700E19081 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A7C716D88DA600E19081 /* Foundation.framework */; }; + 5BF0A7F816D88DA700E19081 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A7CB16D88DA600E19081 /* CoreData.framework */; }; + 5BF0A80016D88DA700E19081 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5BF0A7FE16D88DA700E19081 /* InfoPlist.strings */; }; + 5BF0A80316D88DA700E19081 /* MyFilesOnlineTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A80216D88DA700E19081 /* MyFilesOnlineTests.m */; }; + 5BF0A89616D8A20600E19081 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5BF0A88516D8A20200E19081 /* InfoPlist.strings */; }; + 5BF0A89716D8A20600E19081 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5BF0A88716D8A20200E19081 /* MainStoryboard_iPad.storyboard */; }; + 5BF0A89816D8A20600E19081 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5BF0A88916D8A20200E19081 /* MainStoryboard_iPhone.storyboard */; }; + 5BF0A89916D8A20600E19081 /* MFODetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A89216D8A20600E19081 /* MFODetailViewController.m */; }; + 5BF0A89A16D8A20600E19081 /* MFOMasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A89416D8A20600E19081 /* MFOMasterViewController.m */; }; + 5BF0A89E16D8A3A400E19081 /* MFORefreshControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A89D16D8A3A400E19081 /* MFORefreshControl.m */; }; + 5BF0A8A016D8A4B900E19081 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A89F16D8A4B900E19081 /* QuartzCore.framework */; }; + 5BF0A8A316D8B3B600E19081 /* MFOConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A8A216D8B3B600E19081 /* MFOConstants.m */; }; + 5BF0A8A616D8B41E00E19081 /* MFOHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A8A516D8B41E00E19081 /* MFOHTTPClient.m */; }; + 5BF0A8AD16D8D47D00E19081 /* MFOToastView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A8AC16D8D47D00E19081 /* MFOToastView.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 5BF0A7F916D88DA700E19081 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5BF0A7B816D88DA600E19081 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 5BF0A7C016D88DA600E19081; + remoteInfo = MyFilesOnline; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 5B426C4C16DA4C9400054A22 /* MyFileInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyFileInfo.h; sourceTree = ""; }; + 5B426C4D16DA4C9400054A22 /* MyFileInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyFileInfo.m; sourceTree = ""; }; + 5B426C5816DA758B00054A22 /* MFOCoreDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOCoreDataManager.h; sourceTree = ""; }; + 5B426C5916DA758B00054A22 /* MFOCoreDataManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFOCoreDataManager.m; sourceTree = ""; }; + 5B426C6B16DAAA3400054A22 /* MFOFileDetailsCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOFileDetailsCell.h; sourceTree = ""; }; + 5B426C6C16DAAA3400054A22 /* MFOFileDetailsCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFOFileDetailsCell.m; sourceTree = ""; }; + 5B7A969D16D91D7500D9CB51 /* MyFilesOnline.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MyFilesOnline.xcdatamodel; sourceTree = ""; }; + 5B7A969F16D91DAB00D9CB51 /* MyDirectoryInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyDirectoryInfo.h; sourceTree = ""; }; + 5B7A96A016D91DAB00D9CB51 /* MyDirectoryInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyDirectoryInfo.m; sourceTree = ""; }; + 5B7A96A316D91DAB00D9CB51 /* MyFileTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyFileTypes.h; sourceTree = ""; }; + 5B7A96A416D91DAB00D9CB51 /* MyFileTypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyFileTypes.m; sourceTree = ""; }; + 5BD5C98816D94B6E00F8E2F8 /* MFOUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOUtility.h; sourceTree = ""; }; + 5BD5C98916D94B6E00F8E2F8 /* MFOUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFOUtility.m; sourceTree = ""; }; + 5BF0A7C116D88DA600E19081 /* MyFilesOnline.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MyFilesOnline.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 5BF0A7C516D88DA600E19081 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 5BF0A7C716D88DA600E19081 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 5BF0A7C916D88DA600E19081 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 5BF0A7CB16D88DA600E19081 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + 5BF0A7CF16D88DA600E19081 /* MyFilesOnline-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MyFilesOnline-Info.plist"; sourceTree = ""; }; + 5BF0A7D116D88DA600E19081 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 5BF0A7D316D88DA600E19081 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 5BF0A7D516D88DA600E19081 /* MyFilesOnline-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MyFilesOnline-Prefix.pch"; sourceTree = ""; }; + 5BF0A7D616D88DA600E19081 /* MFOAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MFOAppDelegate.h; sourceTree = ""; }; + 5BF0A7D716D88DA600E19081 /* MFOAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MFOAppDelegate.m; sourceTree = ""; }; + 5BF0A7D916D88DA600E19081 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; + 5BF0A7DB16D88DA600E19081 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; + 5BF0A7DD16D88DA600E19081 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + 5BF0A7F316D88DA700E19081 /* MyFilesOnlineTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MyFilesOnlineTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; + 5BF0A7F416D88DA700E19081 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; + 5BF0A7FD16D88DA700E19081 /* MyFilesOnlineTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MyFilesOnlineTests-Info.plist"; sourceTree = ""; }; + 5BF0A7FF16D88DA700E19081 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 5BF0A80116D88DA700E19081 /* MyFilesOnlineTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyFilesOnlineTests.h; sourceTree = ""; }; + 5BF0A80216D88DA700E19081 /* MyFilesOnlineTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyFilesOnlineTests.m; sourceTree = ""; }; + 5BF0A88616D8A20200E19081 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = InfoPlist.strings; sourceTree = ""; }; + 5BF0A88816D8A20200E19081 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = MainStoryboard_iPad.storyboard; sourceTree = ""; }; + 5BF0A88A16D8A20200E19081 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = MainStoryboard_iPhone.storyboard; sourceTree = ""; }; + 5BF0A89116D8A20600E19081 /* MFODetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFODetailViewController.h; sourceTree = ""; }; + 5BF0A89216D8A20600E19081 /* MFODetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFODetailViewController.m; sourceTree = ""; }; + 5BF0A89316D8A20600E19081 /* MFOMasterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOMasterViewController.h; sourceTree = ""; }; + 5BF0A89416D8A20600E19081 /* MFOMasterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFOMasterViewController.m; sourceTree = ""; }; + 5BF0A89C16D8A3A400E19081 /* MFORefreshControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFORefreshControl.h; sourceTree = ""; }; + 5BF0A89D16D8A3A400E19081 /* MFORefreshControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFORefreshControl.m; sourceTree = ""; }; + 5BF0A89F16D8A4B900E19081 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 5BF0A8A116D8B3B600E19081 /* MFOConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOConstants.h; sourceTree = ""; }; + 5BF0A8A216D8B3B600E19081 /* MFOConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFOConstants.m; sourceTree = ""; }; + 5BF0A8A416D8B41E00E19081 /* MFOHTTPClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOHTTPClient.h; sourceTree = ""; }; + 5BF0A8A516D8B41E00E19081 /* MFOHTTPClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFOHTTPClient.m; sourceTree = ""; }; + 5BF0A8AB16D8D47C00E19081 /* MFOToastView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOToastView.h; sourceTree = ""; }; + 5BF0A8AC16D8D47D00E19081 /* MFOToastView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFOToastView.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 5BF0A7BE16D88DA600E19081 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 5BF0A8A016D8A4B900E19081 /* QuartzCore.framework in Frameworks */, + 5BF0A7C616D88DA600E19081 /* UIKit.framework in Frameworks */, + 5BF0A7C816D88DA600E19081 /* Foundation.framework in Frameworks */, + 5BF0A7CA16D88DA600E19081 /* CoreGraphics.framework in Frameworks */, + 5BF0A7CC16D88DA600E19081 /* CoreData.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5BF0A7EF16D88DA700E19081 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 5BF0A7F516D88DA700E19081 /* SenTestingKit.framework in Frameworks */, + 5BF0A7F616D88DA700E19081 /* UIKit.framework in Frameworks */, + 5BF0A7F716D88DA700E19081 /* Foundation.framework in Frameworks */, + 5BF0A7F816D88DA700E19081 /* CoreData.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 5BF0A7B616D88DA600E19081 = { + isa = PBXGroup; + children = ( + 5BF0A7CD16D88DA600E19081 /* MyFilesOnline */, + 5BF0A7FB16D88DA700E19081 /* MyFilesOnlineTests */, + 5BF0A7C416D88DA600E19081 /* Frameworks */, + 5BF0A7C216D88DA600E19081 /* Products */, + ); + sourceTree = ""; + }; + 5BF0A7C216D88DA600E19081 /* Products */ = { + isa = PBXGroup; + children = ( + 5BF0A7C116D88DA600E19081 /* MyFilesOnline.app */, + 5BF0A7F316D88DA700E19081 /* MyFilesOnlineTests.octest */, + ); + name = Products; + sourceTree = ""; + }; + 5BF0A7C416D88DA600E19081 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 5BF0A89F16D8A4B900E19081 /* QuartzCore.framework */, + 5BF0A7C516D88DA600E19081 /* UIKit.framework */, + 5BF0A7C716D88DA600E19081 /* Foundation.framework */, + 5BF0A7C916D88DA600E19081 /* CoreGraphics.framework */, + 5BF0A7CB16D88DA600E19081 /* CoreData.framework */, + 5BF0A7F416D88DA700E19081 /* SenTestingKit.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 5BF0A7CD16D88DA600E19081 /* MyFilesOnline */ = { + isa = PBXGroup; + children = ( + 5BF0A7D616D88DA600E19081 /* MFOAppDelegate.h */, + 5BF0A7D716D88DA600E19081 /* MFOAppDelegate.m */, + 5BF0A89016D8A20400E19081 /* view_controllers */, + 5BF0A87F16D8A20100E19081 /* classes */, + 5BF0A88016D8A20100E19081 /* custom_gui_components */, + 5BF0A88C16D8A20300E19081 /* model */, + 5BF0A88116D8A20200E19081 /* data */, + 5BF0A88416D8A20200E19081 /* storyboard */, + 5BF0A88B16D8A20200E19081 /* lib */, + 5BF0A88D16D8A20400E19081 /* resource */, + 5BF0A7CE16D88DA600E19081 /* Supporting Files */, + ); + path = MyFilesOnline; + sourceTree = ""; + }; + 5BF0A7CE16D88DA600E19081 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 5BF0A7CF16D88DA600E19081 /* MyFilesOnline-Info.plist */, + 5BF0A7D016D88DA600E19081 /* InfoPlist.strings */, + 5BF0A7D316D88DA600E19081 /* main.m */, + 5BF0A7D516D88DA600E19081 /* MyFilesOnline-Prefix.pch */, + 5BF0A7D916D88DA600E19081 /* Default.png */, + 5BF0A7DB16D88DA600E19081 /* Default@2x.png */, + 5BF0A7DD16D88DA600E19081 /* Default-568h@2x.png */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 5BF0A7FB16D88DA700E19081 /* MyFilesOnlineTests */ = { + isa = PBXGroup; + children = ( + 5BF0A80116D88DA700E19081 /* MyFilesOnlineTests.h */, + 5BF0A80216D88DA700E19081 /* MyFilesOnlineTests.m */, + 5BF0A7FC16D88DA700E19081 /* Supporting Files */, + ); + path = MyFilesOnlineTests; + sourceTree = ""; + }; + 5BF0A7FC16D88DA700E19081 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 5BF0A7FD16D88DA700E19081 /* MyFilesOnlineTests-Info.plist */, + 5BF0A7FE16D88DA700E19081 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 5BF0A87F16D8A20100E19081 /* classes */ = { + isa = PBXGroup; + children = ( + 5BF0A8A116D8B3B600E19081 /* MFOConstants.h */, + 5BF0A8A216D8B3B600E19081 /* MFOConstants.m */, + 5BF0A8A416D8B41E00E19081 /* MFOHTTPClient.h */, + 5BF0A8A516D8B41E00E19081 /* MFOHTTPClient.m */, + 5BD5C98816D94B6E00F8E2F8 /* MFOUtility.h */, + 5BD5C98916D94B6E00F8E2F8 /* MFOUtility.m */, + 5B426C5816DA758B00054A22 /* MFOCoreDataManager.h */, + 5B426C5916DA758B00054A22 /* MFOCoreDataManager.m */, + ); + path = classes; + sourceTree = ""; + }; + 5BF0A88016D8A20100E19081 /* custom_gui_components */ = { + isa = PBXGroup; + children = ( + 5BF0A8AB16D8D47C00E19081 /* MFOToastView.h */, + 5BF0A8AC16D8D47D00E19081 /* MFOToastView.m */, + 5BF0A89C16D8A3A400E19081 /* MFORefreshControl.h */, + 5BF0A89D16D8A3A400E19081 /* MFORefreshControl.m */, + 5B426C6B16DAAA3400054A22 /* MFOFileDetailsCell.h */, + 5B426C6C16DAAA3400054A22 /* MFOFileDetailsCell.m */, + ); + path = custom_gui_components; + sourceTree = ""; + }; + 5BF0A88116D8A20200E19081 /* data */ = { + isa = PBXGroup; + children = ( + 5B7A969C16D91D7500D9CB51 /* MyFilesOnline.xcdatamodeld */, + ); + path = data; + sourceTree = ""; + }; + 5BF0A88416D8A20200E19081 /* storyboard */ = { + isa = PBXGroup; + children = ( + 5BF0A88516D8A20200E19081 /* InfoPlist.strings */, + 5BF0A88716D8A20200E19081 /* MainStoryboard_iPad.storyboard */, + 5BF0A88916D8A20200E19081 /* MainStoryboard_iPhone.storyboard */, + ); + name = storyboard; + path = en.lproj; + sourceTree = ""; + }; + 5BF0A88B16D8A20200E19081 /* lib */ = { + isa = PBXGroup; + children = ( + ); + path = lib; + sourceTree = ""; + }; + 5BF0A88C16D8A20300E19081 /* model */ = { + isa = PBXGroup; + children = ( + 5B7A969F16D91DAB00D9CB51 /* MyDirectoryInfo.h */, + 5B7A96A016D91DAB00D9CB51 /* MyDirectoryInfo.m */, + 5B7A96A316D91DAB00D9CB51 /* MyFileTypes.h */, + 5B7A96A416D91DAB00D9CB51 /* MyFileTypes.m */, + 5B426C4C16DA4C9400054A22 /* MyFileInfo.h */, + 5B426C4D16DA4C9400054A22 /* MyFileInfo.m */, + ); + path = model; + sourceTree = ""; + }; + 5BF0A88D16D8A20400E19081 /* resource */ = { + isa = PBXGroup; + children = ( + 5BF0A88E16D8A20400E19081 /* images */, + ); + path = resource; + sourceTree = ""; + }; + 5BF0A88E16D8A20400E19081 /* images */ = { + isa = PBXGroup; + children = ( + ); + path = images; + sourceTree = ""; + }; + 5BF0A89016D8A20400E19081 /* view_controllers */ = { + isa = PBXGroup; + children = ( + 5BF0A89316D8A20600E19081 /* MFOMasterViewController.h */, + 5BF0A89416D8A20600E19081 /* MFOMasterViewController.m */, + 5BF0A89116D8A20600E19081 /* MFODetailViewController.h */, + 5BF0A89216D8A20600E19081 /* MFODetailViewController.m */, + ); + path = view_controllers; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 5BF0A7C016D88DA600E19081 /* MyFilesOnline */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5BF0A80616D88DA700E19081 /* Build configuration list for PBXNativeTarget "MyFilesOnline" */; + buildPhases = ( + 5BF0A7BD16D88DA600E19081 /* Sources */, + 5BF0A7BE16D88DA600E19081 /* Frameworks */, + 5BF0A7BF16D88DA600E19081 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MyFilesOnline; + productName = MyFilesOnline; + productReference = 5BF0A7C116D88DA600E19081 /* MyFilesOnline.app */; + productType = "com.apple.product-type.application"; + }; + 5BF0A7F216D88DA700E19081 /* MyFilesOnlineTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5BF0A80916D88DA700E19081 /* Build configuration list for PBXNativeTarget "MyFilesOnlineTests" */; + buildPhases = ( + 5BF0A7EE16D88DA700E19081 /* Sources */, + 5BF0A7EF16D88DA700E19081 /* Frameworks */, + 5BF0A7F016D88DA700E19081 /* Resources */, + 5BF0A7F116D88DA700E19081 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 5BF0A7FA16D88DA700E19081 /* PBXTargetDependency */, + ); + name = MyFilesOnlineTests; + productName = MyFilesOnlineTests; + productReference = 5BF0A7F316D88DA700E19081 /* MyFilesOnlineTests.octest */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 5BF0A7B816D88DA600E19081 /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = MFO; + LastUpgradeCheck = 0450; + ORGANIZATIONNAME = "Warif Akhand Rishi"; + }; + buildConfigurationList = 5BF0A7BB16D88DA600E19081 /* Build configuration list for PBXProject "MyFilesOnline" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 5BF0A7B616D88DA600E19081; + productRefGroup = 5BF0A7C216D88DA600E19081 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 5BF0A7C016D88DA600E19081 /* MyFilesOnline */, + 5BF0A7F216D88DA700E19081 /* MyFilesOnlineTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 5BF0A7BF16D88DA600E19081 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5BF0A7D216D88DA600E19081 /* InfoPlist.strings in Resources */, + 5BF0A7DA16D88DA600E19081 /* Default.png in Resources */, + 5BF0A7DC16D88DA600E19081 /* Default@2x.png in Resources */, + 5BF0A7DE16D88DA600E19081 /* Default-568h@2x.png in Resources */, + 5BF0A89616D8A20600E19081 /* InfoPlist.strings in Resources */, + 5BF0A89716D8A20600E19081 /* MainStoryboard_iPad.storyboard in Resources */, + 5BF0A89816D8A20600E19081 /* MainStoryboard_iPhone.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5BF0A7F016D88DA700E19081 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5BF0A80016D88DA700E19081 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 5BF0A7F116D88DA700E19081 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 5BF0A7BD16D88DA600E19081 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5BF0A7D416D88DA600E19081 /* main.m in Sources */, + 5BF0A7D816D88DA600E19081 /* MFOAppDelegate.m in Sources */, + 5BF0A89916D8A20600E19081 /* MFODetailViewController.m in Sources */, + 5BF0A89A16D8A20600E19081 /* MFOMasterViewController.m in Sources */, + 5BF0A89E16D8A3A400E19081 /* MFORefreshControl.m in Sources */, + 5BF0A8A316D8B3B600E19081 /* MFOConstants.m in Sources */, + 5BF0A8A616D8B41E00E19081 /* MFOHTTPClient.m in Sources */, + 5BF0A8AD16D8D47D00E19081 /* MFOToastView.m in Sources */, + 5B7A969E16D91D7500D9CB51 /* MyFilesOnline.xcdatamodeld in Sources */, + 5B7A96A516D91DAB00D9CB51 /* MyDirectoryInfo.m in Sources */, + 5B7A96A716D91DAB00D9CB51 /* MyFileTypes.m in Sources */, + 5BD5C98A16D94B6E00F8E2F8 /* MFOUtility.m in Sources */, + 5B426C4E16DA4C9400054A22 /* MyFileInfo.m in Sources */, + 5B426C5A16DA758B00054A22 /* MFOCoreDataManager.m in Sources */, + 5B426C6D16DAAA3400054A22 /* MFOFileDetailsCell.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5BF0A7EE16D88DA700E19081 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5BF0A80316D88DA700E19081 /* MyFilesOnlineTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 5BF0A7FA16D88DA700E19081 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 5BF0A7C016D88DA600E19081 /* MyFilesOnline */; + targetProxy = 5BF0A7F916D88DA700E19081 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 5BF0A7D016D88DA600E19081 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 5BF0A7D116D88DA600E19081 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 5BF0A7FE16D88DA700E19081 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 5BF0A7FF16D88DA700E19081 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 5BF0A88516D8A20200E19081 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 5BF0A88616D8A20200E19081 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 5BF0A88716D8A20200E19081 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 5BF0A88816D8A20200E19081 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + 5BF0A88916D8A20200E19081 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 5BF0A88A16D8A20200E19081 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 5BF0A80416D88DA700E19081 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 5BF0A80516D88DA700E19081 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 5BF0A80716D88DA700E19081 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "MyFilesOnline/MyFilesOnline-Prefix.pch"; + INFOPLIST_FILE = "MyFilesOnline/MyFilesOnline-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 5BF0A80816D88DA700E19081 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "MyFilesOnline/MyFilesOnline-Prefix.pch"; + INFOPLIST_FILE = "MyFilesOnline/MyFilesOnline-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 5BF0A80A16D88DA700E19081 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MyFilesOnline.app/MyFilesOnline"; + FRAMEWORK_SEARCH_PATHS = ( + "\"$(SDKROOT)/Developer/Library/Frameworks\"", + "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "MyFilesOnline/MyFilesOnline-Prefix.pch"; + INFOPLIST_FILE = "MyFilesOnlineTests/MyFilesOnlineTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = octest; + }; + name = Debug; + }; + 5BF0A80B16D88DA700E19081 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MyFilesOnline.app/MyFilesOnline"; + FRAMEWORK_SEARCH_PATHS = ( + "\"$(SDKROOT)/Developer/Library/Frameworks\"", + "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "MyFilesOnline/MyFilesOnline-Prefix.pch"; + INFOPLIST_FILE = "MyFilesOnlineTests/MyFilesOnlineTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = octest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 5BF0A7BB16D88DA600E19081 /* Build configuration list for PBXProject "MyFilesOnline" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5BF0A80416D88DA700E19081 /* Debug */, + 5BF0A80516D88DA700E19081 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 5BF0A80616D88DA700E19081 /* Build configuration list for PBXNativeTarget "MyFilesOnline" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5BF0A80716D88DA700E19081 /* Debug */, + 5BF0A80816D88DA700E19081 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 5BF0A80916D88DA700E19081 /* Build configuration list for PBXNativeTarget "MyFilesOnlineTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5BF0A80A16D88DA700E19081 /* Debug */, + 5BF0A80B16D88DA700E19081 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCVersionGroup section */ + 5B7A969C16D91D7500D9CB51 /* MyFilesOnline.xcdatamodeld */ = { + isa = XCVersionGroup; + children = ( + 5B7A969D16D91D7500D9CB51 /* MyFilesOnline.xcdatamodel */, + ); + currentVersion = 5B7A969D16D91D7500D9CB51 /* MyFilesOnline.xcdatamodel */; + path = MyFilesOnline.xcdatamodeld; + sourceTree = ""; + versionGroupType = wrapper.xcdatamodel; + }; +/* End XCVersionGroup section */ + }; + rootObject = 5BF0A7B816D88DA600E19081 /* Project object */; +} diff --git a/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..dd00f50 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.xcworkspace/xcuserdata/Rishi.xcuserdatad/UserInterfaceState.xcuserstate b/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.xcworkspace/xcuserdata/Rishi.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..a05241f Binary files /dev/null and b/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.xcworkspace/xcuserdata/Rishi.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.xcworkspace/xcuserdata/Rishi.xcuserdatad/WorkspaceSettings.xcsettings b/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.xcworkspace/xcuserdata/Rishi.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.xcworkspace/xcuserdata/Rishi.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcschemes/MyFilesOnline.xcscheme b/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcschemes/MyFilesOnline.xcscheme new file mode 100644 index 0000000..ec33dcb --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcschemes/MyFilesOnline.xcscheme @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcschemes/xcschememanagement.plist b/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..c28d325 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + MyFilesOnline.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 5BF0A7C016D88DA600E19081 + + primary + + + 5BF0A7F216D88DA700E19081 + + primary + + + + + diff --git a/ARC/MyFilesOnline/MyFilesOnline/Default-568h@2x.png b/ARC/MyFilesOnline/MyFilesOnline/Default-568h@2x.png new file mode 100644 index 0000000..0891b7a Binary files /dev/null and b/ARC/MyFilesOnline/MyFilesOnline/Default-568h@2x.png differ diff --git a/ARC/MyFilesOnline/MyFilesOnline/Default.png b/ARC/MyFilesOnline/MyFilesOnline/Default.png new file mode 100644 index 0000000..4c8ca6f Binary files /dev/null and b/ARC/MyFilesOnline/MyFilesOnline/Default.png differ diff --git a/ARC/MyFilesOnline/MyFilesOnline/Default@2x.png b/ARC/MyFilesOnline/MyFilesOnline/Default@2x.png new file mode 100644 index 0000000..35b84cf Binary files /dev/null and b/ARC/MyFilesOnline/MyFilesOnline/Default@2x.png differ diff --git a/ARC/MyFilesOnline/MyFilesOnline/MFOAppDelegate.h b/ARC/MyFilesOnline/MyFilesOnline/MFOAppDelegate.h new file mode 100644 index 0000000..d748c94 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/MFOAppDelegate.h @@ -0,0 +1,22 @@ +// +// MFOAppDelegate.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@interface MFOAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext; +@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel; +@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator; + +- (void)saveContext; +- (NSURL *)applicationDocumentsDirectory; + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/MFOAppDelegate.m b/ARC/MyFilesOnline/MyFilesOnline/MFOAppDelegate.m new file mode 100644 index 0000000..16840f0 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/MFOAppDelegate.m @@ -0,0 +1,163 @@ +// +// MFOAppDelegate.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOAppDelegate.h" + +#import "MFOMasterViewController.h" + +@implementation MFOAppDelegate + + +@synthesize managedObjectContext = _managedObjectContext; +@synthesize managedObjectModel = _managedObjectModel; +@synthesize persistentStoreCoordinator = _persistentStoreCoordinator; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { + UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController; + UINavigationController *navigationController = [splitViewController.viewControllers lastObject]; + splitViewController.delegate = (id)navigationController.topViewController; + + UINavigationController *masterNavigationController = splitViewController.viewControllers[0]; + MFOMasterViewController *controller = (MFOMasterViewController *)masterNavigationController.topViewController; + controller.managedObjectContext = self.managedObjectContext; + } else { + UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController; + MFOMasterViewController *controller = (MFOMasterViewController *)navigationController.topViewController; + controller.managedObjectContext = self.managedObjectContext; + } + + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application +{ + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application +{ + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + +- (void)applicationWillEnterForeground:(UIApplication *)application +{ + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application +{ + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + +- (void)applicationWillTerminate:(UIApplication *)application +{ + // Saves changes in the application's managed object context before the application terminates. + [self saveContext]; +} + +- (void)saveContext +{ + NSError *error = nil; + NSManagedObjectContext *managedObjectContext = self.managedObjectContext; + if (managedObjectContext != nil) { + if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error]) { + // Replace this implementation with code to handle the error appropriately. + // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + NSLog(@"Unresolved error %@, %@", error, [error userInfo]); + abort(); + } + } +} + +#pragma mark - Core Data stack + +// Returns the managed object context for the application. +// If the context doesn't already exist, it is created and bound to the persistent store coordinator for the application. +- (NSManagedObjectContext *)managedObjectContext +{ + if (_managedObjectContext != nil) { + return _managedObjectContext; + } + + NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; + if (coordinator != nil) { + _managedObjectContext = [[NSManagedObjectContext alloc] init]; + [_managedObjectContext setPersistentStoreCoordinator:coordinator]; + } + return _managedObjectContext; +} + +// Returns the managed object model for the application. +// If the model doesn't already exist, it is created from the application's model. +- (NSManagedObjectModel *)managedObjectModel +{ + if (_managedObjectModel != nil) { + return _managedObjectModel; + } + NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"MyFilesOnline" withExtension:@"momd"]; + _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; + return _managedObjectModel; +} + +// Returns the persistent store coordinator for the application. +// If the coordinator doesn't already exist, it is created and the application's store added to it. +- (NSPersistentStoreCoordinator *)persistentStoreCoordinator +{ + if (_persistentStoreCoordinator != nil) { + return _persistentStoreCoordinator; + } + + NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"MyFilesOnline.sqlite"]; + + NSError *error = nil; + _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; + if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) { + /* + Replace this implementation with code to handle the error appropriately. + + abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + + Typical reasons for an error here include: + * The persistent store is not accessible; + * The schema for the persistent store is incompatible with current managed object model. + Check the error message to determine what the actual problem was. + + + If the persistent store is not accessible, there is typically something wrong with the file path. Often, a file URL is pointing into the application's resources directory instead of a writeable directory. + + If you encounter schema incompatibility errors during development, you can reduce their frequency by: + * Simply deleting the existing store: + [[NSFileManager defaultManager] removeItemAtURL:storeURL error:nil] + + * Performing automatic lightweight migration by passing the following dictionary as the options parameter: + @{NSMigratePersistentStoresAutomaticallyOption:@YES, NSInferMappingModelAutomaticallyOption:@YES} + + Lightweight migration will only work for a limited set of schema changes; consult "Core Data Model Versioning and Data Migration Programming Guide" for details. + + */ + NSLog(@"Unresolved error %@, %@", error, [error userInfo]); + abort(); + } + + return _persistentStoreCoordinator; +} + +#pragma mark - Application's Documents directory + +// Returns the URL to the application's Documents directory. +- (NSURL *)applicationDocumentsDirectory +{ + return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; +} + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline-Info.plist b/ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline-Info.plist new file mode 100644 index 0000000..601cdb4 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline-Info.plist @@ -0,0 +1,51 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.war.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarStyle + UIStatusBarStyleBlackTranslucent + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline-Prefix.pch b/ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline-Prefix.pch new file mode 100644 index 0000000..267900d --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline-Prefix.pch @@ -0,0 +1,15 @@ +// +// Prefix header for all source files of the 'MyFilesOnline' target in the 'MyFilesOnline' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import + #import +#endif diff --git a/ARC/MyFilesOnline/MyFilesOnline/classes/MFOConstants.h b/ARC/MyFilesOnline/MyFilesOnline/classes/MFOConstants.h new file mode 100644 index 0000000..648307b --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/classes/MFOConstants.h @@ -0,0 +1,12 @@ +// +// MFOConstants.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + + +extern NSString * const MFO_URL; + +extern int const FETCH_BATCH_SIZE; \ No newline at end of file diff --git a/ARC/MyFilesOnline/MyFilesOnline/classes/MFOConstants.m b/ARC/MyFilesOnline/MyFilesOnline/classes/MFOConstants.m new file mode 100644 index 0000000..bdfd9bb --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/classes/MFOConstants.m @@ -0,0 +1,14 @@ +// +// MFOConstants.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOConstants.h" + + +NSString * const MFO_URL = @"https://gist.github.com/raw/4680060/aac6d818e7103edfe721e719b1512f707bcfb478/sample.json"; + +int const FETCH_BATCH_SIZE = 20; \ No newline at end of file diff --git a/ARC/MyFilesOnline/MyFilesOnline/classes/MFOCoreDataManager.h b/ARC/MyFilesOnline/MyFilesOnline/classes/MFOCoreDataManager.h new file mode 100644 index 0000000..d4ab64d --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/classes/MFOCoreDataManager.h @@ -0,0 +1,22 @@ +// +// MFOCoreDataManager.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/24/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@class MyFileTypes; +@class MyDirectoryInfo; + +@interface MFOCoreDataManager : NSObject + +@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController; + +- (void)populateDatabaseWithJSON:(NSDictionary*)dictionary; +- (void)clearDatabase; +- (MyDirectoryInfo*)getDirectoryInfoFromDatabase; + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/classes/MFOCoreDataManager.m b/ARC/MyFilesOnline/MyFilesOnline/classes/MFOCoreDataManager.m new file mode 100644 index 0000000..a652431 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/classes/MFOCoreDataManager.m @@ -0,0 +1,133 @@ +// +// MFOCoreDataManager.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/24/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOCoreDataManager.h" +#import "MyDirectoryInfo.h" +#import "MyFileTypes.h" +#import "MyFileInfo.h" +#import "MFOUtility.h" +#import "MFOConstants.h" + +@implementation MFOCoreDataManager + +- (void)populateDatabaseWithJSON:(NSDictionary*)dictionary +{ + NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; + + MyDirectoryInfo *myDirectoryInfo = [NSEntityDescription insertNewObjectForEntityForName:@"MyDirectoryInfo"inManagedObjectContext:context]; + + myDirectoryInfo.availableSpace = [dictionary valueForKeyPath:@"availableSpace"]; + myDirectoryInfo.last_rev_id = [dictionary valueForKeyPath:@"last_rev_id"]; + myDirectoryInfo.mode = [dictionary valueForKeyPath:@"mode"]; + myDirectoryInfo.my_files_count = [NSNumber numberWithInt:[[dictionary valueForKeyPath:@"my_files.content"] count]]; + myDirectoryInfo.pendingRequests = [dictionary valueForKeyPath:@"pendingRequests"]; + myDirectoryInfo.rev_id = [dictionary valueForKeyPath:@"rev_id"]; + myDirectoryInfo.shared_files_count = [NSNumber numberWithInt:[[dictionary valueForKeyPath:@"shared_files.content"] count]]; + myDirectoryInfo.totalSpace = [dictionary valueForKeyPath:@"totalSpace"]; + myDirectoryInfo.usedSpace = [dictionary valueForKeyPath:@"usedSpace"]; + + NSDictionary *fileType = [dictionary valueForKeyPath:@"my_files"]; + MyFileTypes *myFileType = [self getMyFileTypeFormDictionary:fileType andContext:context]; + myFileType.directoryInfo = myDirectoryInfo; + + NSDictionary *fileTypeShared = [dictionary valueForKeyPath:@"shared_files"]; + MyFileTypes *myFileTypeShared = [self getMyFileTypeFormDictionary:fileTypeShared andContext:context]; + myFileTypeShared.directoryInfo = myDirectoryInfo; + + myDirectoryInfo.fileTypes = [[NSSet alloc] initWithObjects:myFileType, myFileTypeShared, nil]; + + NSError *error; + if (![context save:&error]) { + NSLog(@"Whoops, couldn't save: %@", [error localizedDescription]); + } +} + +- (MyFileTypes*)getMyFileTypeFormDictionary:(NSDictionary*)fileType andContext:(NSManagedObjectContext*)context +{ + MyFileTypes *myFileTypes = [NSEntityDescription insertNewObjectForEntityForName:@"MyFileType" inManagedObjectContext:context]; + + myFileTypes.id = [fileType valueForKeyPath:@"id"]; + myFileTypes.name = [fileType valueForKeyPath:@"name"]; + + NSMutableArray *myFiles = [[NSMutableArray alloc] init]; + + for (NSDictionary *contentDictionary in [fileType valueForKeyPath:@"content"]) + { + MyFileInfo *fileInfo = [NSEntityDescription insertNewObjectForEntityForName:@"MyFileInfo" inManagedObjectContext:context]; + + fileInfo.created_date = [MFOUtility getDateFromString:[contentDictionary valueForKeyPath:@"created_date"]]; + fileInfo.is_shared = [NSNumber numberWithBool:[[contentDictionary valueForKeyPath:@"is_shared"] boolValue]]; + fileInfo.item_id = [contentDictionary valueForKeyPath:@"item_id"]; + fileInfo.last_updated_by = [contentDictionary valueForKeyPath:@"last_updated_by"]; + fileInfo.last_updated_date = [MFOUtility getDateFromString:[contentDictionary valueForKeyPath:@"last_updated_date"]]; + fileInfo.link = [contentDictionary valueForKeyPath:@"link"]; + fileInfo.mime_type = [contentDictionary valueForKeyPath:@"mime_type"]; + fileInfo.name = [contentDictionary valueForKeyPath:@"name"]; + id parentId = [contentDictionary valueForKeyPath:@"parent_id"]; + fileInfo.parent_id = ([parentId isKindOfClass:[NSNull class]]) ? nil : parentId; + fileInfo.path = [contentDictionary valueForKeyPath:@"path"]; + fileInfo.path_by_id = [contentDictionary valueForKeyPath:@"path_by_id"]; + fileInfo.share_id = [contentDictionary valueForKeyPath:@"share_id"]; + id shareLevel = [contentDictionary valueForKeyPath:@"share_level"]; + fileInfo.share_level = ([shareLevel isKindOfClass:[NSNumber class]]) ? shareLevel : nil; + fileInfo.shared_by = [contentDictionary valueForKeyPath:@"shared_by"]; + fileInfo.shared_date = [MFOUtility getDateFromString:[contentDictionary valueForKeyPath:@"shared_date"]]; + fileInfo.size = [contentDictionary valueForKeyPath:@"size"]; + fileInfo.status = [contentDictionary valueForKeyPath:@"status"]; + fileInfo.type = [contentDictionary valueForKeyPath:@"type"]; + fileInfo.user_id = [contentDictionary valueForKeyPath:@"user_id"]; + fileInfo.parentFileTypes = myFileTypes; + + [myFiles addObject:fileInfo]; + } + + myFileTypes.fileInfo = [[NSSet alloc] initWithArray:myFiles]; + + return myFileTypes; +} + +- (void)clearDatabase +{ + //Erase the persistent store from coordinator and also file manager. + NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; + NSPersistentStore *store = [context.persistentStoreCoordinator.persistentStores lastObject]; + NSError *error = nil; + NSURL *storeURL = store.URL; + [context.persistentStoreCoordinator removePersistentStore:store error:&error]; + [[NSFileManager defaultManager] removeItemAtURL:storeURL error:&error]; + + //Make new persistent store for future saves + if (![context.persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) + { + NSLog(@"Database clear error"); + } +} + +- (MyDirectoryInfo*)getDirectoryInfoFromDatabase +{ + NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; + // Edit the entity name as appropriate. + NSEntityDescription *entity = [NSEntityDescription entityForName:@"MyDirectoryInfo" inManagedObjectContext:[self.fetchedResultsController managedObjectContext]]; + [fetchRequest setEntity:entity]; + + // Set the batch size to a suitable number. + [fetchRequest setFetchBatchSize:FETCH_BATCH_SIZE]; + + NSError *error; + + NSArray *fetchedObjects = [[self.fetchedResultsController managedObjectContext] executeFetchRequest:fetchRequest error:&error]; + + MyDirectoryInfo *directoryInfo = nil; + + for (MyDirectoryInfo *myDirectoryInfo in fetchedObjects) + directoryInfo = myDirectoryInfo; + + return directoryInfo; +} + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/classes/MFOHTTPClient.h b/ARC/MyFilesOnline/MyFilesOnline/classes/MFOHTTPClient.h new file mode 100644 index 0000000..97c98b5 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/classes/MFOHTTPClient.h @@ -0,0 +1,30 @@ +// +// MFOHTTPClient.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@protocol HTTPClientDelegate; + +@interface MFOHTTPClient : NSObject + +- (id)initWithURL:(NSURL*)URL andDelegate:(id)delegate; + +@end + + +@protocol HTTPClientDelegate + +@required +- (void)HTTPClientDidReceiveData:(NSData*)data; + +@optional +- (void)HTTPClientDidReceiveEmpty; +- (void)HTTPClientDidTimeOut; +- (void)HTTPClientDownloadError:(NSString*)errorMessage; + +@end \ No newline at end of file diff --git a/ARC/MyFilesOnline/MyFilesOnline/classes/MFOHTTPClient.m b/ARC/MyFilesOnline/MyFilesOnline/classes/MFOHTTPClient.m new file mode 100644 index 0000000..7bfcea5 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/classes/MFOHTTPClient.m @@ -0,0 +1,39 @@ +// +// MFOHTTPClient.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOHTTPClient.h" + +@implementation MFOHTTPClient + +- (id)initWithURL:(NSURL*)URL andDelegate:(id)delegate +{ + if (self = [super init]) + { + NSURLRequest *request = [NSURLRequest requestWithURL:URL]; + + // !!!: sendAsynchronousRequest:queue:completionHandler: sends a request asynchronously (i.e., in the background, not blocking the main thread). When the response comes back, the handler block is dispatched to the queue specified in the queue. + + [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) + { + if ([data length] > 0 && error == nil && [delegate respondsToSelector:@selector(HTTPClientDidReceiveData:)]) + [delegate HTTPClientDidReceiveData:data]; + else if ([data length] == 0 && error == nil && [delegate respondsToSelector:@selector(HTTPClientDidReceiveEmpty)]) + [delegate HTTPClientDidReceiveEmpty]; + else if (error != nil && error.code == NSURLErrorTimedOut && [delegate respondsToSelector:@selector(HTTPClientDidTimeOut)]) + [delegate HTTPClientDidTimeOut]; + else if (error != nil && [delegate respondsToSelector:@selector(HTTPClientDownloadError:)]) + [delegate HTTPClientDownloadError:[error localizedDescription]]; + }]; + } + + return self; +} + + + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/classes/MFOUtility.h b/ARC/MyFilesOnline/MyFilesOnline/classes/MFOUtility.h new file mode 100644 index 0000000..fdfca78 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/classes/MFOUtility.h @@ -0,0 +1,18 @@ +// +// MFOUtility.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/24/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@interface MFOUtility : NSObject + ++ (NSString*)convertbyteToKB_MB:(long long)byte; ++ (NSDictionary*)getJSONDictionnaryFromData:(NSData*)data; ++ (NSDate*)getDateFromString:(NSString*)dateString; ++ (NSString*)getStringFromDate:(NSDate*)date; + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/classes/MFOUtility.m b/ARC/MyFilesOnline/MyFilesOnline/classes/MFOUtility.m new file mode 100644 index 0000000..62c63a9 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/classes/MFOUtility.m @@ -0,0 +1,64 @@ +// +// MFOUtility.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/24/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOUtility.h" + +@implementation MFOUtility + ++ (NSString*)convertbyteToKB_MB:(long long)byte +{ + NSString *retSize = [NSString stringWithFormat:@"%lld bytes",byte]; + float fByte = byte; + + if (byte > 1024) + { + //Kilobytes + fByte = fByte / 1024; + retSize = [NSString stringWithFormat:@"%.1f KB",fByte]; + } + + if (fByte > 1024) + { + //Megabytes + fByte = fByte / 1024; + retSize = [NSString stringWithFormat:@"%.1f MB",fByte]; + } + + if (fByte > 1024) + { + //GB + fByte = fByte / 1024; + retSize = [NSString stringWithFormat:@"%.1f GB",fByte]; + } + + return retSize; +} + ++ (NSDictionary*)getJSONDictionnaryFromData:(NSData*)data +{ + NSError *jsonError; + return [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError]; +} + ++ (NSDate*)getDateFromString:(NSString*)dateString +{ + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; + return [dateFormatter dateFromString:dateString]; +} + ++ (NSString*)getStringFromDate:(NSDate*)date +{ + NSDateFormatter *format = [[NSDateFormatter alloc] init]; + [format setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; + NSString *retStr = [format stringFromDate:date]; + + return retStr; +} + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOFileDetailsCell.h b/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOFileDetailsCell.h new file mode 100644 index 0000000..02a47d1 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOFileDetailsCell.h @@ -0,0 +1,24 @@ +// +// MFOFileDetailsCell.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/25/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@interface MFOFileDetailsCell : UITableViewCell + +@property (nonatomic, strong) IBOutlet UILabel *nameLabel; +@property (nonatomic, strong) IBOutlet UILabel *lastUpdatedByLabel; +@property (nonatomic, strong) IBOutlet UILabel *statusLabel; +@property (nonatomic, strong) IBOutlet UILabel *sharedByLabel; +@property (nonatomic, strong) IBOutlet UILabel *pathLabel; +@property (nonatomic, strong) IBOutlet UILabel *linkLabel; +@property (nonatomic, strong) IBOutlet UILabel *updateDateLabel; +@property (nonatomic, strong) IBOutlet UILabel *createDateLabel; +@property (nonatomic, strong) IBOutlet UILabel *shareDateLabel; + + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOFileDetailsCell.m b/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOFileDetailsCell.m new file mode 100644 index 0000000..c7f7a56 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOFileDetailsCell.m @@ -0,0 +1,39 @@ +// +// MFOFileDetailsCell.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/25/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOFileDetailsCell.h" + +@implementation MFOFileDetailsCell + +@synthesize nameLabel; +@synthesize lastUpdatedByLabel; +@synthesize statusLabel; +@synthesize sharedByLabel; +@synthesize pathLabel; +@synthesize linkLabel; +@synthesize updateDateLabel; +@synthesize createDateLabel; +@synthesize shareDateLabel; + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) { + // Initialization code + } + return self; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFORefreshControl.h b/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFORefreshControl.h new file mode 100644 index 0000000..f5773ef --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFORefreshControl.h @@ -0,0 +1,44 @@ +// +// MFORefreshControl.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import +#import + +@interface MFORefreshControl : UIControl +{ + CAShapeLayer *_shapeLayer; + CAShapeLayer *_arrowLayer; + CAShapeLayer *_highlightLayer; + UIView *_activity; + BOOL _refreshing; + BOOL _canRefresh; + BOOL _ignoreInset; + BOOL _ignoreOffset; + BOOL _didSetInset; + BOOL _hasSectionHeaders; + CGFloat _lastOffset; +} + +@property (nonatomic, readonly) BOOL refreshing; +@property (nonatomic, strong) UIColor *tintColor; +@property (nonatomic, assign) UIActivityIndicatorViewStyle activityIndicatorViewStyle; +@property (nonatomic, strong) UIColor *activityIndicatorViewColor; // iOS5 or more + +- (id)initInScrollView:(UIScrollView *)scrollView; + +// use custom activity indicator +- (id)initInScrollView:(UIScrollView *)scrollView activityIndicatorView:(UIView *)activity; + +// Tells the control that a refresh operation was started programmatically +- (void)beginRefreshing; + +// Tells the control the refresh operation has ended +- (void)endRefreshing; + + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFORefreshControl.m b/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFORefreshControl.m new file mode 100644 index 0000000..f4a6e4c --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFORefreshControl.m @@ -0,0 +1,454 @@ +// +// MFORefreshControl.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFORefreshControl.h" + +#define kTotalViewHeight 400 +#define kOpenedViewHeight 44 +#define kMinTopPadding 9 +#define kMaxTopPadding 5 +#define kMinTopRadius 12.5 +#define kMaxTopRadius 16 +#define kMinBottomRadius 3 +#define kMaxBottomRadius 16 +#define kMinBottomPadding 4 +#define kMaxBottomPadding 6 +#define kMinArrowSize 2 +#define kMaxArrowSize 3 +#define kMinArrowRadius 5 +#define kMaxArrowRadius 7 +#define kMaxDistance 53 + + +@interface MFORefreshControl () + +@property (nonatomic, readwrite) BOOL refreshing; +@property (nonatomic, assign) UIScrollView *scrollView; +@property (nonatomic, assign) UIEdgeInsets originalContentInset; + +@end + + +@implementation MFORefreshControl + +@synthesize refreshing = _refreshing; +@synthesize tintColor = _tintColor; + +@synthesize scrollView = _scrollView; +@synthesize originalContentInset = _originalContentInset; + +static inline CGFloat lerp(CGFloat a, CGFloat b, CGFloat p) +{ + return a + (b - a) * p; +} + +- (id)initInScrollView:(UIScrollView *)scrollView { + return [self initInScrollView:scrollView activityIndicatorView:nil]; +} + +- (id)initInScrollView:(UIScrollView *)scrollView activityIndicatorView:(UIView *)activity +{ + self = [super initWithFrame:CGRectMake(0, -(kTotalViewHeight /*+ scrollView.contentInset.top*/), scrollView.frame.size.width, kTotalViewHeight)]; + + if (self) { + self.scrollView = scrollView; + self.originalContentInset = scrollView.contentInset; + + self.autoresizingMask = UIViewAutoresizingFlexibleWidth; + [scrollView addSubview:self]; + [scrollView addObserver:self forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionNew context:nil]; + [scrollView addObserver:self forKeyPath:@"contentInset" options:NSKeyValueObservingOptionNew context:nil]; + + _activity = activity ? activity : [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; + _activity.center = CGPointMake(floor(self.frame.size.width / 2), floor(self.frame.size.height / 2)); + _activity.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; + _activity.alpha = 0; + if ([_activity respondsToSelector:@selector(startAnimating)]) { + [(UIActivityIndicatorView *)_activity startAnimating]; + } + [self addSubview:_activity]; + + _refreshing = NO; + _canRefresh = YES; + _ignoreInset = NO; + _ignoreOffset = NO; + _didSetInset = NO; + _hasSectionHeaders = NO; + _tintColor = [UIColor colorWithRed:155.0 / 255.0 green:162.0 / 255.0 blue:172.0 / 255.0 alpha:1.0]; + + _shapeLayer = [CAShapeLayer layer]; + _shapeLayer.fillColor = [_tintColor CGColor]; + _shapeLayer.strokeColor = [[[UIColor darkGrayColor] colorWithAlphaComponent:0.5] CGColor]; + _shapeLayer.lineWidth = 0.5; + _shapeLayer.shadowColor = [[UIColor blackColor] CGColor]; + _shapeLayer.shadowOffset = CGSizeMake(0, 1); + _shapeLayer.shadowOpacity = 0.4; + _shapeLayer.shadowRadius = 0.5; + [self.layer addSublayer:_shapeLayer]; + + _arrowLayer = [CAShapeLayer layer]; + _arrowLayer.strokeColor = [[[UIColor darkGrayColor] colorWithAlphaComponent:0.5] CGColor]; + _arrowLayer.lineWidth = 0.5; + _arrowLayer.fillColor = [[UIColor whiteColor] CGColor]; + [_shapeLayer addSublayer:_arrowLayer]; + + _highlightLayer = [CAShapeLayer layer]; + _highlightLayer.fillColor = [[[UIColor whiteColor] colorWithAlphaComponent:0.2] CGColor]; + [_shapeLayer addSublayer:_highlightLayer]; + } + return self; +} + +- (void)setEnabled:(BOOL)enabled +{ + super.enabled = enabled; + _shapeLayer.hidden = !self.enabled; +} + +- (void)willMoveToSuperview:(UIView *)newSuperview +{ + [super willMoveToSuperview:newSuperview]; + if (!newSuperview) { + [self.scrollView removeObserver:self forKeyPath:@"contentOffset"]; + [self.scrollView removeObserver:self forKeyPath:@"contentInset"]; + self.scrollView = nil; + } +} + +- (void)setTintColor:(UIColor *)tintColor +{ + _tintColor = tintColor; + _shapeLayer.fillColor = [_tintColor CGColor]; +} + +- (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle +{ + if ([_activity isKindOfClass:[UIActivityIndicatorView class]]) { + [(UIActivityIndicatorView *)_activity setActivityIndicatorViewStyle:activityIndicatorViewStyle]; + } +} + +- (UIActivityIndicatorViewStyle)activityIndicatorViewStyle +{ + if ([_activity isKindOfClass:[UIActivityIndicatorView class]]) { + return [(UIActivityIndicatorView *)_activity activityIndicatorViewStyle]; + } + return 0; +} + +- (void)setActivityIndicatorViewColor:(UIColor *)activityIndicatorViewColor +{ + if ([_activity isKindOfClass:[UIActivityIndicatorView class]] && [_activity respondsToSelector:@selector(setColor:)]) { + [(UIActivityIndicatorView *)_activity setColor:activityIndicatorViewColor]; + } +} + +- (UIColor *)activityIndicatorViewColor +{ + if ([_activity isKindOfClass:[UIActivityIndicatorView class]] && [_activity respondsToSelector:@selector(color)]) { + return [(UIActivityIndicatorView *)_activity color]; + } + return nil; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + if ([keyPath isEqualToString:@"contentInset"]) { + if (!_ignoreInset) { + self.originalContentInset = [[change objectForKey:@"new"] UIEdgeInsetsValue]; + self.frame = CGRectMake(0, -(kTotalViewHeight /*+ self.scrollView.contentInset.top*/), self.scrollView.frame.size.width, kTotalViewHeight); + } + return; + } + + if (!self.enabled || _ignoreOffset) { + return; + } + + CGFloat offset = [[change objectForKey:@"new"] CGPointValue].y + self.originalContentInset.top; + + //Fixed bug when scroll up. Date: 23 Feb 2013 + if (offset > 0) + return; + + if (_refreshing) { + if (offset != 0) { + // Keep thing pinned at the top + + [CATransaction begin]; + [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; + _shapeLayer.position = CGPointMake(0, kMaxDistance + offset + kOpenedViewHeight); + [CATransaction commit]; + + _activity.center = CGPointMake(floor(self.frame.size.width / 2), MIN(offset + self.frame.size.height + floor(kOpenedViewHeight / 2), self.frame.size.height - kOpenedViewHeight/ 2)); + + _ignoreInset = YES; + _ignoreOffset = YES; + + if (offset < 0) { + // Set the inset depending on the situation + if (offset >= -kOpenedViewHeight) { + if (!self.scrollView.dragging) { + if (!_didSetInset) { + _didSetInset = YES; + _hasSectionHeaders = NO; + if([self.scrollView isKindOfClass:[UITableView class]]){ + for (int i = 0; i < [(UITableView *)self.scrollView numberOfSections]; ++i) { + if ([(UITableView *)self.scrollView rectForHeaderInSection:i].size.height) { + _hasSectionHeaders = YES; + break; + } + } + } + } + if (_hasSectionHeaders) { + [self.scrollView setContentInset:UIEdgeInsetsMake(MIN(-offset, kOpenedViewHeight) + self.originalContentInset.top, self.originalContentInset.left, self.originalContentInset.bottom, self.originalContentInset.right)]; + } else { + [self.scrollView setContentInset:UIEdgeInsetsMake(kOpenedViewHeight + self.originalContentInset.top, self.originalContentInset.left, self.originalContentInset.bottom, self.originalContentInset.right)]; + } + } else if (_didSetInset && _hasSectionHeaders) { + [self.scrollView setContentInset:UIEdgeInsetsMake(-offset + self.originalContentInset.top, self.originalContentInset.left, self.originalContentInset.bottom, self.originalContentInset.right)]; + } + } + } else if (_hasSectionHeaders) { + [self.scrollView setContentInset:self.originalContentInset]; + } + _ignoreInset = NO; + _ignoreOffset = NO; + } + return; + } else { + // Check if we can trigger a new refresh and if we can draw the control + BOOL dontDraw = NO; + if (!_canRefresh) { + if (offset >= 0) { + // We can refresh again after the control is scrolled out of view + _canRefresh = YES; + _didSetInset = NO; + } else { + dontDraw = YES; + } + } else { + if (offset >= 0) { + // Don't draw if the control is not visible + dontDraw = YES; + } + } + if (offset > 0 && _lastOffset > offset && !self.scrollView.isTracking) { + // If we are scrolling too fast, don't draw, and don't trigger unless the scrollView bounced back + _canRefresh = NO; + dontDraw = YES; + } + if (dontDraw) { + _shapeLayer.path = nil; + _shapeLayer.shadowPath = nil; + _arrowLayer.path = nil; + _highlightLayer.path = nil; + _lastOffset = offset; + return; + } + } + + _lastOffset = offset; + + BOOL triggered = NO; + + CGMutablePathRef path = CGPathCreateMutable(); + + //Calculate some useful points and values + CGFloat verticalShift = MAX(0, -((kMaxTopRadius + kMaxBottomRadius + kMaxTopPadding + kMaxBottomPadding) + offset)); + CGFloat distance = MIN(kMaxDistance, fabs(verticalShift)); + CGFloat percentage = 1 - (distance / kMaxDistance); + + CGFloat currentTopPadding = lerp(kMinTopPadding, kMaxTopPadding, percentage); + CGFloat currentTopRadius = lerp(kMinTopRadius, kMaxTopRadius, percentage); + CGFloat currentBottomRadius = lerp(kMinBottomRadius, kMaxBottomRadius, percentage); + CGFloat currentBottomPadding = lerp(kMinBottomPadding, kMaxBottomPadding, percentage); + + CGPoint bottomOrigin = CGPointMake(floor(self.bounds.size.width / 2), self.bounds.size.height - currentBottomPadding -currentBottomRadius); + CGPoint topOrigin = CGPointZero; + if (distance == 0) { + topOrigin = CGPointMake(floor(self.bounds.size.width / 2), bottomOrigin.y); + } else { + topOrigin = CGPointMake(floor(self.bounds.size.width / 2), self.bounds.size.height + offset + currentTopPadding + currentTopRadius); + if (percentage == 0) { + bottomOrigin.y -= (fabs(verticalShift) - kMaxDistance); + triggered = YES; + } + } + + //Top semicircle + CGPathAddArc(path, NULL, topOrigin.x, topOrigin.y, currentTopRadius, 0, M_PI, YES); + + //Left curve + CGPoint leftCp1 = CGPointMake(lerp((topOrigin.x - currentTopRadius), (bottomOrigin.x - currentBottomRadius), 0.1), lerp(topOrigin.y, bottomOrigin.y, 0.2)); + CGPoint leftCp2 = CGPointMake(lerp((topOrigin.x - currentTopRadius), (bottomOrigin.x - currentBottomRadius), 0.9), lerp(topOrigin.y, bottomOrigin.y, 0.2)); + CGPoint leftDestination = CGPointMake(bottomOrigin.x - currentBottomRadius, bottomOrigin.y); + + CGPathAddCurveToPoint(path, NULL, leftCp1.x, leftCp1.y, leftCp2.x, leftCp2.y, leftDestination.x, leftDestination.y); + + //Bottom semicircle + CGPathAddArc(path, NULL, bottomOrigin.x, bottomOrigin.y, currentBottomRadius, M_PI, 0, YES); + + //Right curve + CGPoint rightCp2 = CGPointMake(lerp((topOrigin.x + currentTopRadius), (bottomOrigin.x + currentBottomRadius), 0.1), lerp(topOrigin.y, bottomOrigin.y, 0.2)); + CGPoint rightCp1 = CGPointMake(lerp((topOrigin.x + currentTopRadius), (bottomOrigin.x + currentBottomRadius), 0.9), lerp(topOrigin.y, bottomOrigin.y, 0.2)); + CGPoint rightDestination = CGPointMake(topOrigin.x + currentTopRadius, topOrigin.y); + + CGPathAddCurveToPoint(path, NULL, rightCp1.x, rightCp1.y, rightCp2.x, rightCp2.y, rightDestination.x, rightDestination.y); + CGPathCloseSubpath(path); + + if (!triggered) { + // Set paths + + _shapeLayer.path = path; + _shapeLayer.shadowPath = path; + + // Add the arrow shape + + CGFloat currentArrowSize = lerp(kMinArrowSize, kMaxArrowSize, percentage); + CGFloat currentArrowRadius = lerp(kMinArrowRadius, kMaxArrowRadius, percentage); + CGFloat arrowBigRadius = currentArrowRadius + (currentArrowSize / 2); + CGFloat arrowSmallRadius = currentArrowRadius - (currentArrowSize / 2); + CGMutablePathRef arrowPath = CGPathCreateMutable(); + CGPathAddArc(arrowPath, NULL, topOrigin.x, topOrigin.y, arrowBigRadius, 0, 3 * M_PI_2, NO); + CGPathAddLineToPoint(arrowPath, NULL, topOrigin.x, topOrigin.y - arrowBigRadius - currentArrowSize); + CGPathAddLineToPoint(arrowPath, NULL, topOrigin.x + (2 * currentArrowSize), topOrigin.y - arrowBigRadius + (currentArrowSize / 2)); + CGPathAddLineToPoint(arrowPath, NULL, topOrigin.x, topOrigin.y - arrowBigRadius + (2 * currentArrowSize)); + CGPathAddLineToPoint(arrowPath, NULL, topOrigin.x, topOrigin.y - arrowBigRadius + currentArrowSize); + CGPathAddArc(arrowPath, NULL, topOrigin.x, topOrigin.y, arrowSmallRadius, 3 * M_PI_2, 0, YES); + CGPathCloseSubpath(arrowPath); + _arrowLayer.path = arrowPath; + [_arrowLayer setFillRule:kCAFillRuleEvenOdd]; + CGPathRelease(arrowPath); + + // Add the highlight shape + + CGMutablePathRef highlightPath = CGPathCreateMutable(); + CGPathAddArc(highlightPath, NULL, topOrigin.x, topOrigin.y, currentTopRadius, 0, M_PI, YES); + CGPathAddArc(highlightPath, NULL, topOrigin.x, topOrigin.y + 1.25, currentTopRadius, M_PI, 0, NO); + + _highlightLayer.path = highlightPath; + [_highlightLayer setFillRule:kCAFillRuleNonZero]; + CGPathRelease(highlightPath); + + } else { + // Start the shape disappearance animation + + CGFloat radius = lerp(kMinBottomRadius, kMaxBottomRadius, 0.2); + CABasicAnimation *pathMorph = [CABasicAnimation animationWithKeyPath:@"path"]; + pathMorph.duration = 0.15; + pathMorph.fillMode = kCAFillModeForwards; + pathMorph.removedOnCompletion = NO; + CGMutablePathRef toPath = CGPathCreateMutable(); + CGPathAddArc(toPath, NULL, topOrigin.x, topOrigin.y, radius, 0, M_PI, YES); + CGPathAddCurveToPoint(toPath, NULL, topOrigin.x - radius, topOrigin.y, topOrigin.x - radius, topOrigin.y, topOrigin.x - radius, topOrigin.y); + CGPathAddArc(toPath, NULL, topOrigin.x, topOrigin.y, radius, M_PI, 0, YES); + CGPathAddCurveToPoint(toPath, NULL, topOrigin.x + radius, topOrigin.y, topOrigin.x + radius, topOrigin.y, topOrigin.x + radius, topOrigin.y); + CGPathCloseSubpath(toPath); + pathMorph.toValue = (__bridge id)toPath; + [_shapeLayer addAnimation:pathMorph forKey:nil]; + CABasicAnimation *shadowPathMorph = [CABasicAnimation animationWithKeyPath:@"shadowPath"]; + shadowPathMorph.duration = 0.15; + shadowPathMorph.fillMode = kCAFillModeForwards; + shadowPathMorph.removedOnCompletion = NO; + shadowPathMorph.toValue = (__bridge id)toPath; + [_shapeLayer addAnimation:shadowPathMorph forKey:nil]; + CGPathRelease(toPath); + CABasicAnimation *shapeAlphaAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; + shapeAlphaAnimation.duration = 0.1; + shapeAlphaAnimation.beginTime = CACurrentMediaTime() + 0.1; + shapeAlphaAnimation.toValue = [NSNumber numberWithFloat:0]; + shapeAlphaAnimation.fillMode = kCAFillModeForwards; + shapeAlphaAnimation.removedOnCompletion = NO; + [_shapeLayer addAnimation:shapeAlphaAnimation forKey:nil]; + CABasicAnimation *alphaAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; + alphaAnimation.duration = 0.1; + alphaAnimation.toValue = [NSNumber numberWithFloat:0]; + alphaAnimation.fillMode = kCAFillModeForwards; + alphaAnimation.removedOnCompletion = NO; + [_arrowLayer addAnimation:alphaAnimation forKey:nil]; + [_highlightLayer addAnimation:alphaAnimation forKey:nil]; + + [CATransaction begin]; + [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; + _activity.layer.transform = CATransform3DMakeScale(0.1, 0.1, 1); + [CATransaction commit]; + [UIView animateWithDuration:0.2 delay:0.15 options:UIViewAnimationOptionCurveLinear animations:^{ + _activity.alpha = 1; + _activity.layer.transform = CATransform3DMakeScale(1, 1, 1); + } completion:nil]; + + self.refreshing = YES; + _canRefresh = NO; + [self sendActionsForControlEvents:UIControlEventValueChanged]; + } + + CGPathRelease(path); +} + +- (void)beginRefreshing +{ + if (!_refreshing) { + CABasicAnimation *alphaAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; + alphaAnimation.duration = 0.0001; + alphaAnimation.toValue = [NSNumber numberWithFloat:0]; + alphaAnimation.fillMode = kCAFillModeForwards; + alphaAnimation.removedOnCompletion = NO; + [_shapeLayer addAnimation:alphaAnimation forKey:nil]; + [_arrowLayer addAnimation:alphaAnimation forKey:nil]; + [_highlightLayer addAnimation:alphaAnimation forKey:nil]; + + _activity.alpha = 1; + _activity.layer.transform = CATransform3DMakeScale(1, 1, 1); + + CGPoint offset = self.scrollView.contentOffset; + _ignoreInset = YES; + [self.scrollView setContentInset:UIEdgeInsetsMake(kOpenedViewHeight + self.originalContentInset.top, self.originalContentInset.left, self.originalContentInset.bottom, self.originalContentInset.right)]; + _ignoreInset = NO; + [self.scrollView setContentOffset:offset animated:NO]; + + self.refreshing = YES; + _canRefresh = NO; + } +} + +- (void)endRefreshing +{ + if (_refreshing) { + self.refreshing = NO; + // Create a temporary retain-cycle, so the scrollView won't be released + // halfway through the end animation. + // This allows for the refresh control to clean up the observer, + // in the case the scrollView is released while the animation is running + __block UIScrollView *blockScrollView = self.scrollView; + [UIView animateWithDuration:0.4 animations:^{ + _ignoreInset = YES; + [blockScrollView setContentInset:self.originalContentInset]; + _ignoreInset = NO; + _activity.alpha = 0; + _activity.layer.transform = CATransform3DMakeScale(0.1, 0.1, 1); + } completion:^(BOOL finished) { + [_shapeLayer removeAllAnimations]; + _shapeLayer.path = nil; + _shapeLayer.shadowPath = nil; + _shapeLayer.position = CGPointZero; + [_arrowLayer removeAllAnimations]; + _arrowLayer.path = nil; + [_highlightLayer removeAllAnimations]; + _highlightLayer.path = nil; + // We need to use the scrollView somehow in the end block, + // or it'll get released in the animation block. + _ignoreInset = YES; + [blockScrollView setContentInset:self.originalContentInset]; + _ignoreInset = NO; + }]; + } +} + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOToastView.h b/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOToastView.h new file mode 100644 index 0000000..be85168 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOToastView.h @@ -0,0 +1,15 @@ +// +// MFOToastView.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/16/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@interface MFOToastView : UIView + +- (id)initWithParentView:(UIView*)parentView withMessage:(NSString*)message; + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOToastView.m b/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOToastView.m new file mode 100644 index 0000000..cc9ceed --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOToastView.m @@ -0,0 +1,70 @@ +// +// MFOToastView.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/16/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOToastView.h" +#import + +#define VIEW_WIDTH 220 +#define VIEW_DEFULT_HEIGHT 160 +#define ANIMATION_DURATION 1.2 + +@implementation MFOToastView + +- (id)initWithParentView:(UIView*)parentView withMessage:(NSString*)message +{ + self = [super init]; + + self.backgroundColor = [UIColor clearColor]; + + UITextView *txtviewMessage =[[UITextView alloc]initWithFrame:CGRectMake(0, 0, VIEW_WIDTH, VIEW_DEFULT_HEIGHT)]; + txtviewMessage.backgroundColor = [UIColor clearColor]; + txtviewMessage.text = message; + txtviewMessage.userInteractionEnabled = NO; + txtviewMessage.font = [UIFont fontWithName:@"Futura" size:16.0f]; + txtviewMessage.textColor = [UIColor whiteColor]; + txtviewMessage.textAlignment = NSTextAlignmentCenter; + [self addSubview:txtviewMessage]; + + CGRect frame = txtviewMessage.frame; + frame.size.height = [txtviewMessage contentSize].height; + float height = [txtviewMessage contentSize].height; + txtviewMessage.frame = CGRectMake(0, 0, VIEW_WIDTH, height); + self.frame = CGRectMake((parentView.frame.size.width - VIEW_WIDTH) / 2, (parentView.frame.size.height - height) / 2, VIEW_WIDTH, height); + + UIView *backView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, VIEW_WIDTH, height)]; + backView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.7f]; + [backView.layer setCornerRadius:4.0f]; + [backView.layer setMasksToBounds:YES]; + [backView.layer setBorderColor:[[UIColor grayColor] CGColor]]; + backView.layer.borderWidth = 1.0; + [self addSubview:backView]; + [self bringSubviewToFront:txtviewMessage]; + [NSTimer scheduledTimerWithTimeInterval:1.2 + target:self + selector:@selector(hideMe:) + userInfo:nil + repeats:NO]; + + return self; +} + +-(void)hideMe:(NSTimer*)timer +{ + [timer invalidate]; + [UIView animateWithDuration:ANIMATION_DURATION + delay:0.0 + options: UIViewAnimationCurveEaseOut + animations:^{ + [self setAlpha:0.0]; + } + completion:^(BOOL finished){ + [self removeFromSuperview]; + }]; +} + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/data/MyFilesOnline.xcdatamodeld/.xccurrentversion b/ARC/MyFilesOnline/MyFilesOnline/data/MyFilesOnline.xcdatamodeld/.xccurrentversion new file mode 100644 index 0000000..ad0ce2c --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/data/MyFilesOnline.xcdatamodeld/.xccurrentversion @@ -0,0 +1,8 @@ + + + + + _XCCurrentVersionName + MyFilesOnline.xcdatamodel + + diff --git a/ARC/MyFilesOnline/MyFilesOnline/data/MyFilesOnline.xcdatamodeld/MyFilesOnline.xcdatamodel/contents b/ARC/MyFilesOnline/MyFilesOnline/data/MyFilesOnline.xcdatamodeld/MyFilesOnline.xcdatamodel/contents new file mode 100644 index 0000000..f59545f --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/data/MyFilesOnline.xcdatamodeld/MyFilesOnline.xcdatamodel/contents @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ARC/MyFilesOnline/MyFilesOnline/en.lproj/InfoPlist.strings b/ARC/MyFilesOnline/MyFilesOnline/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/ARC/MyFilesOnline/MyFilesOnline/en.lproj/MainStoryboard_iPad.storyboard b/ARC/MyFilesOnline/MyFilesOnline/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..42f4b8f --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ARC/MyFilesOnline/MyFilesOnline/en.lproj/MainStoryboard_iPhone.storyboard b/ARC/MyFilesOnline/MyFilesOnline/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..8adf8db --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ARC/MyFilesOnline/MyFilesOnline/main.m b/ARC/MyFilesOnline/MyFilesOnline/main.m new file mode 100644 index 0000000..b270370 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/main.m @@ -0,0 +1,18 @@ +// +// main.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +#import "MFOAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([MFOAppDelegate class])); + } +} diff --git a/ARC/MyFilesOnline/MyFilesOnline/model/MyDirectoryInfo.h b/ARC/MyFilesOnline/MyFilesOnline/model/MyDirectoryInfo.h new file mode 100644 index 0000000..f36d184 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/model/MyDirectoryInfo.h @@ -0,0 +1,35 @@ +// +// MyDirectoryInfo.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import +#import + +@class MyFileTypes; + +@interface MyDirectoryInfo : NSManagedObject + +@property (nonatomic, strong) NSNumber * availableSpace; +@property (nonatomic, strong) NSNumber * last_rev_id; +@property (nonatomic, strong) NSString * mode; +@property (nonatomic, strong) NSNumber * my_files_count; +@property (nonatomic, strong) NSNumber * pendingRequests; +@property (nonatomic, strong) NSNumber * rev_id; +@property (nonatomic, strong) NSNumber * shared_files_count; +@property (nonatomic, strong) NSNumber * totalSpace; +@property (nonatomic, strong) NSNumber * usedSpace; +@property (nonatomic, strong) NSSet *fileTypes; +@end + +@interface MyDirectoryInfo (CoreDataGeneratedAccessors) + +- (void)addFileTypesObject:(MyFileTypes *)value; +- (void)removeFileTypesObject:(MyFileTypes *)value; +- (void)addFileTypes:(NSSet *)values; +- (void)removeFileTypes:(NSSet *)values; + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/model/MyDirectoryInfo.m b/ARC/MyFilesOnline/MyFilesOnline/model/MyDirectoryInfo.m new file mode 100644 index 0000000..2b0e2a2 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/model/MyDirectoryInfo.m @@ -0,0 +1,26 @@ +// +// MyDirectoryInfo.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MyDirectoryInfo.h" +#import "MyFileTypes.h" + + +@implementation MyDirectoryInfo + +@dynamic availableSpace; +@dynamic last_rev_id; +@dynamic mode; +@dynamic my_files_count; +@dynamic pendingRequests; +@dynamic rev_id; +@dynamic shared_files_count; +@dynamic totalSpace; +@dynamic usedSpace; +@dynamic fileTypes; + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/model/MyFileInfo.h b/ARC/MyFilesOnline/MyFilesOnline/model/MyFileInfo.h new file mode 100644 index 0000000..9db34e9 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/model/MyFileInfo.h @@ -0,0 +1,37 @@ +// +// MyFileInfo.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/24/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import +#import + +@class MyFileTypes; + +@interface MyFileInfo : NSManagedObject + +@property (nonatomic, strong) NSDate * created_date; +@property (nonatomic, strong) NSNumber * is_shared; +@property (nonatomic, strong) NSNumber * item_id; +@property (nonatomic, strong) NSString * last_updated_by; +@property (nonatomic, strong) NSDate * last_updated_date; +@property (nonatomic, strong) NSString * link; +@property (nonatomic, strong) NSString * mime_type; +@property (nonatomic, strong) NSString * name; +@property (nonatomic, strong) NSNumber * parent_id; +@property (nonatomic, strong) NSString * path; +@property (nonatomic, strong) NSString * path_by_id; +@property (nonatomic, strong) NSString * share_id; +@property (nonatomic, strong) NSNumber * share_level; +@property (nonatomic, strong) NSNumber * shared_by; +@property (nonatomic, strong) NSDate * shared_date; +@property (nonatomic, strong) NSNumber * size; +@property (nonatomic, strong) NSString * status; +@property (nonatomic, strong) NSString * type; +@property (nonatomic, strong) NSNumber * user_id; +@property (nonatomic, strong) MyFileTypes *parentFileTypes; + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/model/MyFileInfo.m b/ARC/MyFilesOnline/MyFilesOnline/model/MyFileInfo.m new file mode 100644 index 0000000..56c1b5f --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/model/MyFileInfo.m @@ -0,0 +1,36 @@ +// +// MyFileInfo.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/24/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MyFileInfo.h" +#import "MyFileTypes.h" + + +@implementation MyFileInfo + +@dynamic created_date; +@dynamic is_shared; +@dynamic item_id; +@dynamic last_updated_by; +@dynamic last_updated_date; +@dynamic link; +@dynamic mime_type; +@dynamic name; +@dynamic parent_id; +@dynamic path; +@dynamic path_by_id; +@dynamic share_id; +@dynamic share_level; +@dynamic shared_by; +@dynamic shared_date; +@dynamic size; +@dynamic status; +@dynamic type; +@dynamic user_id; +@dynamic parentFileTypes; + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/model/MyFileTypes.h b/ARC/MyFilesOnline/MyFilesOnline/model/MyFileTypes.h new file mode 100644 index 0000000..063d496 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/model/MyFileTypes.h @@ -0,0 +1,29 @@ +// +// MyFileTypes.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import +#import + +@class MyDirectoryInfo, MyFileInfo; + +@interface MyFileTypes : NSManagedObject + +@property (nonatomic, strong) NSString * id; +@property (nonatomic, strong) NSString * name; +@property (nonatomic, strong) MyDirectoryInfo *directoryInfo; +@property (nonatomic, strong) NSSet *fileInfo; +@end + +@interface MyFileTypes (CoreDataGeneratedAccessors) + +- (void)addFileInfoObject:(MyFileInfo *)value; +- (void)removeFileInfoObject:(MyFileInfo *)value; +- (void)addFileInfo:(NSSet *)values; +- (void)removeFileInfo:(NSSet *)values; + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/model/MyFileTypes.m b/ARC/MyFilesOnline/MyFilesOnline/model/MyFileTypes.m new file mode 100644 index 0000000..f646b36 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/model/MyFileTypes.m @@ -0,0 +1,21 @@ +// +// MyFileTypes.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MyFileTypes.h" +#import "MyDirectoryInfo.h" +#import "MyFileInfo.h" + + +@implementation MyFileTypes + +@dynamic id; +@dynamic name; +@dynamic directoryInfo; +@dynamic fileInfo; + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFODetailViewController.h b/ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFODetailViewController.h new file mode 100644 index 0000000..acabc91 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFODetailViewController.h @@ -0,0 +1,20 @@ +// +// MFODetailViewController.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@interface MFODetailViewController : UITableViewController +{ + int visibleRowCount; +} + +@property (nonatomic, strong) NSManagedObjectContext* managedObjectContext; +@property (nonatomic, strong) NSFetchedResultsController *fetchedResultsController; +@property (nonatomic, strong) NSString *parentFileTypeId; + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFODetailViewController.m b/ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFODetailViewController.m new file mode 100644 index 0000000..8cd45f9 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFODetailViewController.m @@ -0,0 +1,208 @@ +// +// MFODetailViewController.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFODetailViewController.h" +#import "MFOConstants.h" +#import "MyFileInfo.h" +#import "MFOFileDetailsCell.h" +#import "MFOUtility.h" + +#define FOOTER_VIEW_HEIGHT 36 + +@interface MFODetailViewController () + +@property (strong, nonatomic) UIPopoverController *masterPopoverController; +- (void)configureView; + +@end + + +@implementation MFODetailViewController + +@synthesize parentFileTypeId; +@synthesize managedObjectContext; +@synthesize fetchedResultsController = _fetchedResultsController; + + +#pragma mark - Managing the NSPredicate item + +- (void)setParentFileTypeId:(NSString*)newParentFileTypeId +{ + if (![self.parentFileTypeId isEqualToString:newParentFileTypeId]) + { + parentFileTypeId = newParentFileTypeId; + + self.fetchedResultsController = nil; + visibleRowCount = FETCH_BATCH_SIZE; + [self configureView]; + } + + if (self.masterPopoverController != nil) { + [self.masterPopoverController dismissPopoverAnimated:YES]; + } +} + +- (void)configureView +{ + NSError *error; + + if (![[self fetchedResultsController] performFetch:&error]) + { + NSLog(@"Unresolved error %@, %@", error, [error userInfo]); + exit(-1); // Fail + } + + [self.tableView reloadData]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; +} + +- (NSFetchedResultsController *)fetchedResultsController +{ + if (_fetchedResultsController != nil) { + return _fetchedResultsController; + } + + NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; + + NSEntityDescription *entity = [NSEntityDescription entityForName:@"MyFileInfo" inManagedObjectContext:managedObjectContext]; + [fetchRequest setEntity:entity]; + + fetchRequest.predicate = [NSPredicate predicateWithFormat:@"parentFileTypes.id==%@", self.parentFileTypeId]; + + NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES]; + [fetchRequest setSortDescriptors:[NSArray arrayWithObject:sort]]; + + [fetchRequest setFetchBatchSize:FETCH_BATCH_SIZE]; + + NSFetchedResultsController *theFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:managedObjectContext sectionNameKeyPath:nil cacheName:nil]; + + self.fetchedResultsController = theFetchedResultsController; + _fetchedResultsController.delegate = self; + + + return _fetchedResultsController; +} + +- (void)configureCell:(MFOFileDetailsCell *)cell atIndexPath:(NSIndexPath *)indexPath +{ + MyFileInfo *fileInfo = [_fetchedResultsController objectAtIndexPath:indexPath]; + + cell.nameLabel.text = fileInfo.name; + cell.lastUpdatedByLabel.text = [NSString stringWithFormat:@"Last updated by: %@", fileInfo.last_updated_by]; + cell.statusLabel.text = [NSString stringWithFormat:@"Status: %@", fileInfo.status]; + cell.sharedByLabel.text = [NSString stringWithFormat:@"Shared by: %@", [fileInfo.shared_by stringValue]]; + cell.pathLabel.text = [NSString stringWithFormat:@"Path: %@", fileInfo.path]; + cell.linkLabel.text = [NSString stringWithFormat:@"Link: %@", fileInfo.link]; + cell.updateDateLabel.text = [NSString stringWithFormat:@"Updated: %@", [MFOUtility getStringFromDate:fileInfo.last_updated_date]]; + cell.createDateLabel.text = [NSString stringWithFormat:@"Created: %@", [MFOUtility getStringFromDate:fileInfo.created_date]]; + cell.shareDateLabel.text = [NSString stringWithFormat:@"Shared: %@", [MFOUtility getStringFromDate:fileInfo.shared_date]]; +} + +- (void)viewDidUnload +{ + self.fetchedResultsController = nil; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + id sectionInfo = [[_fetchedResultsController sections] objectAtIndex:section]; + int totalNumberOfObjects = [sectionInfo numberOfObjects]; + + if (totalNumberOfObjects > visibleRowCount) + return visibleRowCount; + else + return totalNumberOfObjects; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *CellIdentifier = @"DetailCell"; + MFOFileDetailsCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; + + [self configureCell:cell atIndexPath:indexPath]; + + return cell; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section +{ + int totalNumberOfObjects = [[[_fetchedResultsController sections] objectAtIndex:0] numberOfObjects]; + + if (totalNumberOfObjects <= visibleRowCount) + return 0.0; + + return FOOTER_VIEW_HEIGHT; +} + +- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section +{ + UIView *footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, FOOTER_VIEW_HEIGHT)]; + footerView.backgroundColor = [UIColor colorWithWhite:.1 alpha:.7]; + + UIButton *loadMoreButton = [UIButton buttonWithType:UIButtonTypeCustom]; + loadMoreButton.frame = footerView.frame; + loadMoreButton.showsTouchWhenHighlighted = YES; + [loadMoreButton setTitle:@"Load more..." forState:UIControlStateNormal]; + [loadMoreButton addTarget:self action:@selector(actionLoadMoreButton:) forControlEvents:UIControlEventTouchUpInside]; + [footerView addSubview:loadMoreButton]; + + loadMoreButton.autoresizingMask = UIViewAutoresizingFlexibleWidth; + + return footerView; +} + +- (void)actionLoadMoreButton:(id)sender +{ + visibleRowCount += FETCH_BATCH_SIZE; + [self.tableView reloadData]; + + id sectionInfo = [[_fetchedResultsController sections] objectAtIndex:0]; + int totalNumberOfObjects = [sectionInfo numberOfObjects]; + + int smallerNumber = visibleRowCount; + + if (visibleRowCount > totalNumberOfObjects) + smallerNumber = totalNumberOfObjects; + + NSIndexPath* ipath = [NSIndexPath indexPathForRow:smallerNumber-1 inSection:0]; + [self.tableView scrollToRowAtIndexPath:ipath atScrollPosition: UITableViewScrollPositionTop animated:YES]; +} + +#pragma mark - Split view + +- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController +{ + barButtonItem.title = NSLocalizedString(@"My directory", @"My directory"); + [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES]; + self.masterPopoverController = popoverController; +} + +- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem +{ + [self.navigationItem setLeftBarButtonItem:nil animated:YES]; + self.masterPopoverController = nil; +} + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFOMasterViewController.h b/ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFOMasterViewController.h new file mode 100644 index 0000000..ff6a0ac --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFOMasterViewController.h @@ -0,0 +1,28 @@ +// +// MFOMasterViewController.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import +#import "MFOHTTPClient.h" + +@class MFODetailViewController; +@class MFOCoreDataManager; +@class MFORefreshControl; + +#import + +@interface MFOMasterViewController : UITableViewController +{ + MFOCoreDataManager *coreDataManager; + MFORefreshControl *refreshControl; +} + +@property (strong, nonatomic) MFODetailViewController *detailViewController; +@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController; +@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext; + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFOMasterViewController.m b/ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFOMasterViewController.m new file mode 100644 index 0000000..b76e669 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFOMasterViewController.m @@ -0,0 +1,280 @@ +// +// MFOMasterViewController.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOMasterViewController.h" +#import "MFODetailViewController.h" +#import "MFORefreshControl.h" +#import "MFOConstants.h" +#import "MFOAppDelegate.h" +#import "MFOUtility.h" +#import "MFOToastView.h" +#import "MyDirectoryInfo.h" +#import "MyFileTypes.h" +#import "MFOCoreDataManager.h" + +@interface MFOMasterViewController () + +@property (nonatomic, strong) MyDirectoryInfo *directoryInfo; + +- (void)refreshControlDidBeginRefreshing:(MFORefreshControl *)refreshControl; +- (NSString*)getFileTypeIdForIndexpath:(NSIndexPath*)indexPath; +- (BOOL)isSharedFilesSelectedOnRow:(int)row; +- (NSString*)getTitleTextForRow:(int)row; +- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath; + +@end + + +@implementation MFOMasterViewController + +@synthesize directoryInfo; + +- (void)awakeFromNib +{ + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) + { + self.clearsSelectionOnViewWillAppear = NO; + self.contentSizeForViewInPopover = CGSizeMake(320.0, 600.0); + } + + [super awakeFromNib]; +} + + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.detailViewController = (MFODetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController]; + + refreshControl = [[MFORefreshControl alloc] initInScrollView:self.tableView]; + [refreshControl addTarget:self action:@selector(refreshControlDidBeginRefreshing:) forControlEvents:UIControlEventValueChanged]; + + coreDataManager = [[MFOCoreDataManager alloc] init]; + coreDataManager.fetchedResultsController = self.fetchedResultsController; + + self.directoryInfo = [coreDataManager getDirectoryInfoFromDatabase]; +} + +- (void)refreshControlDidBeginRefreshing:(MFORefreshControl *)refreshControl +{ + MFOHTTPClient *httpClient = [[MFOHTTPClient alloc] initWithURL:[NSURL URLWithString:MFO_URL] andDelegate:self]; + NSLog(@"sending url request...%@", httpClient.description); +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; +} + +#pragma mark - Table View + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 9; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; + [self configureCell:cell atIndexPath:indexPath]; + + return cell; +} + +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath +{ + return NO; +} + +- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath +{ + return NO; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) + { + NSString *myFileTypeId = [self getFileTypeIdForIndexpath:indexPath]; + + self.detailViewController.managedObjectContext = self.managedObjectContext; + self.detailViewController.parentFileTypeId = myFileTypeId; + self.detailViewController.title = [self getTitleTextForRow:indexPath.row]; + } +} + +- (BOOL)isSharedFilesSelectedOnRow:(int)row +{ + return (row == 8) ? TRUE : FALSE; +} + +- (NSString*)getTitleTextForRow:(int)row +{ + return ([self isSharedFilesSelectedOnRow:row]) ? @"My Shared Files" : @"My Files"; +} + +- (NSString*)getFileTypeIdForIndexpath:(NSIndexPath*)indexPath +{ + NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"id" ascending:YES]; + NSArray *sortDescriptors = @[sortDescriptor]; + + return [[[directoryInfo.fileTypes sortedArrayUsingDescriptors:sortDescriptors] objectAtIndex:[self isSharedFilesSelectedOnRow:indexPath.row]] id]; +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender +{ + if ([[segue identifier] isEqualToString:@"showDetail"]) + { + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + + NSString *myFileTypeId = [self getFileTypeIdForIndexpath:indexPath]; + + [segue.destinationViewController setManagedObjectContext:self.managedObjectContext]; + [[segue destinationViewController] setParentFileTypeId:myFileTypeId]; + [segue.destinationViewController setTitle:[self getTitleTextForRow:indexPath.row]]; + } +} + +#pragma mark - Fetched results controller + +- (NSFetchedResultsController *)fetchedResultsController +{ + if (_fetchedResultsController != nil) { + return _fetchedResultsController; + } + + NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; + NSEntityDescription *entity = [NSEntityDescription entityForName:@"MyDirectoryInfo" inManagedObjectContext:self.managedObjectContext]; + [fetchRequest setEntity:entity]; + + [fetchRequest setFetchBatchSize:FETCH_BATCH_SIZE]; + + NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"rev_id" ascending:NO]; + NSArray *sortDescriptors = @[sortDescriptor]; + + [fetchRequest setSortDescriptors:sortDescriptors]; + + NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:self.managedObjectContext sectionNameKeyPath:nil cacheName:@"Master"]; + + aFetchedResultsController.delegate = self; + self.fetchedResultsController = aFetchedResultsController; + + NSError *error = nil; + if (![self.fetchedResultsController performFetch:&error]) + { + NSLog(@"Unresolved error %@, %@", error, [error userInfo]); + abort(); + } + + return _fetchedResultsController; +} + +- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath +{ + cell.accessoryType = UITableViewCellAccessoryNone; + cell.userInteractionEnabled = NO; + + switch (indexPath.row) + { + case 0: + cell.detailTextLabel.text = [MFOUtility convertbyteToKB_MB:[self.directoryInfo.totalSpace longLongValue]]; + cell.textLabel.text = @"Total space"; + break; + case 1: + cell.detailTextLabel.text = [self.directoryInfo.last_rev_id stringValue]; + cell.textLabel.text = @"Last rev id"; + break; + case 2: + cell.detailTextLabel.text = [MFOUtility convertbyteToKB_MB:[self.directoryInfo.usedSpace longLongValue]]; + cell.textLabel.text = @"Used space"; + break; + case 3: + cell.detailTextLabel.text = [MFOUtility convertbyteToKB_MB:[self.directoryInfo.availableSpace longLongValue]]; + cell.textLabel.text = @"Available space"; + break; + case 4: + cell.detailTextLabel.text = self.directoryInfo.mode; + cell.textLabel.text = @"Mode"; + break; + case 5: + cell.detailTextLabel.text = [self.directoryInfo.pendingRequests stringValue]; + cell.textLabel.text = @"Pending requests"; + break; + case 6: + cell.detailTextLabel.text = [self.directoryInfo.my_files_count stringValue]; + cell.textLabel.text = @"My files count"; + cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + cell.userInteractionEnabled = YES; + break; + case 7: + cell.detailTextLabel.text = [self.directoryInfo.rev_id stringValue]; + cell.textLabel.text = @"Rev id"; + break; + case 8: + cell.detailTextLabel.text = [self.directoryInfo.shared_files_count stringValue]; + cell.textLabel.text = @"Shared files count"; + cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + cell.userInteractionEnabled = YES; + break; + default: + cell.textLabel.text = @"Extra"; + cell.detailTextLabel.text = @"Extra"; + break; + } +} + +#pragma mark - HTTPClient Delegate Methods + +- (void)HTTPClientDidReceiveData:(NSData*)data +{ + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^ + { + NSDictionary *jSONResponce = [MFOUtility getJSONDictionnaryFromData:data]; + [coreDataManager clearDatabase]; + self.fetchedResultsController = nil; + [coreDataManager populateDatabaseWithJSON:jSONResponce]; + self.directoryInfo = [coreDataManager getDirectoryInfoFromDatabase]; + dispatch_async(dispatch_get_main_queue(), ^ + { + [refreshControl endRefreshing]; + [self.tableView reloadData]; + }); + }); +} + +- (void)HTTPClientDidReceiveEmpty +{ + [refreshControl endRefreshing]; + + MFOToastView *toastView = [[MFOToastView alloc] initWithParentView:self.view withMessage:@"Request returns empty"]; + [self.view addSubview:toastView]; +} + +- (void)HTTPClientDidTimeOut +{ + [refreshControl endRefreshing]; + + MFOToastView *toastView = [[MFOToastView alloc] initWithParentView:self.view withMessage:@"Request timed out"]; + [self.view addSubview:toastView]; +} + +- (void)HTTPClientDownloadError:(NSString*)errorMessage +{ + [refreshControl endRefreshing]; + + MFOToastView *toastView = [[MFOToastView alloc] initWithParentView:self.view withMessage:@"Download Error"]; + [self.view addSubview:toastView]; +} + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests-Info.plist b/ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests-Info.plist new file mode 100644 index 0000000..d828dde --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.war.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests.h b/ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests.h new file mode 100644 index 0000000..0c902f4 --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests.h @@ -0,0 +1,13 @@ +// +// MyFilesOnlineTests.h +// MyFilesOnlineTests +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@interface MyFilesOnlineTests : SenTestCase + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests.m b/ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests.m new file mode 100644 index 0000000..9dbbe8f --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests.m @@ -0,0 +1,46 @@ +// +// MyFilesOnlineTests.m +// MyFilesOnlineTests +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MyFilesOnlineTests.h" +#import "MFOConstants.h" + +@implementation MyFilesOnlineTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testSTAssertTrue +{ + NSString *testString = @"testString"; + STAssertTrue([testString isEqualToString:@"testString"], @""); +} + +- (void)testSTAssertFalse +{ + NSString *testString = @"testString"; + STAssertFalse([testString isEqualToString:@"not testString"], @""); +} + +- (void)testSTAssertEqualObjects +{ + NSString *testString = @"testString"; + STAssertEqualObjects(testString, testString, @""); +} + +@end diff --git a/ARC/MyFilesOnline/MyFilesOnlineTests/en.lproj/InfoPlist.strings b/ARC/MyFilesOnline/MyFilesOnlineTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/ARC/MyFilesOnline/MyFilesOnlineTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.pbxproj b/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e897e90 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.pbxproj @@ -0,0 +1,658 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 5B426C4E16DA4C9400054A22 /* MyFileInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B426C4D16DA4C9400054A22 /* MyFileInfo.m */; }; + 5B426C5A16DA758B00054A22 /* MFOCoreDataManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B426C5916DA758B00054A22 /* MFOCoreDataManager.m */; }; + 5B426C6D16DAAA3400054A22 /* MFOFileDetailsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B426C6C16DAAA3400054A22 /* MFOFileDetailsCell.m */; }; + 5B7A969E16D91D7500D9CB51 /* MyFilesOnline.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 5B7A969C16D91D7500D9CB51 /* MyFilesOnline.xcdatamodeld */; }; + 5B7A96A516D91DAB00D9CB51 /* MyDirectoryInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B7A96A016D91DAB00D9CB51 /* MyDirectoryInfo.m */; }; + 5B7A96A716D91DAB00D9CB51 /* MyFileTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B7A96A416D91DAB00D9CB51 /* MyFileTypes.m */; }; + 5BD5C98A16D94B6E00F8E2F8 /* MFOUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BD5C98916D94B6E00F8E2F8 /* MFOUtility.m */; }; + 5BF0A7C616D88DA600E19081 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A7C516D88DA600E19081 /* UIKit.framework */; }; + 5BF0A7C816D88DA600E19081 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A7C716D88DA600E19081 /* Foundation.framework */; }; + 5BF0A7CA16D88DA600E19081 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A7C916D88DA600E19081 /* CoreGraphics.framework */; }; + 5BF0A7CC16D88DA600E19081 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A7CB16D88DA600E19081 /* CoreData.framework */; }; + 5BF0A7D216D88DA600E19081 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5BF0A7D016D88DA600E19081 /* InfoPlist.strings */; }; + 5BF0A7D416D88DA600E19081 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A7D316D88DA600E19081 /* main.m */; }; + 5BF0A7D816D88DA600E19081 /* MFOAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A7D716D88DA600E19081 /* MFOAppDelegate.m */; }; + 5BF0A7DA16D88DA600E19081 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 5BF0A7D916D88DA600E19081 /* Default.png */; }; + 5BF0A7DC16D88DA600E19081 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5BF0A7DB16D88DA600E19081 /* Default@2x.png */; }; + 5BF0A7DE16D88DA600E19081 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5BF0A7DD16D88DA600E19081 /* Default-568h@2x.png */; }; + 5BF0A7F516D88DA700E19081 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A7F416D88DA700E19081 /* SenTestingKit.framework */; }; + 5BF0A7F616D88DA700E19081 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A7C516D88DA600E19081 /* UIKit.framework */; }; + 5BF0A7F716D88DA700E19081 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A7C716D88DA600E19081 /* Foundation.framework */; }; + 5BF0A7F816D88DA700E19081 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A7CB16D88DA600E19081 /* CoreData.framework */; }; + 5BF0A80016D88DA700E19081 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5BF0A7FE16D88DA700E19081 /* InfoPlist.strings */; }; + 5BF0A80316D88DA700E19081 /* MyFilesOnlineTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A80216D88DA700E19081 /* MyFilesOnlineTests.m */; }; + 5BF0A89616D8A20600E19081 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5BF0A88516D8A20200E19081 /* InfoPlist.strings */; }; + 5BF0A89716D8A20600E19081 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5BF0A88716D8A20200E19081 /* MainStoryboard_iPad.storyboard */; }; + 5BF0A89816D8A20600E19081 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5BF0A88916D8A20200E19081 /* MainStoryboard_iPhone.storyboard */; }; + 5BF0A89916D8A20600E19081 /* MFODetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A89216D8A20600E19081 /* MFODetailViewController.m */; }; + 5BF0A89A16D8A20600E19081 /* MFOMasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A89416D8A20600E19081 /* MFOMasterViewController.m */; }; + 5BF0A89E16D8A3A400E19081 /* MFORefreshControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A89D16D8A3A400E19081 /* MFORefreshControl.m */; }; + 5BF0A8A016D8A4B900E19081 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BF0A89F16D8A4B900E19081 /* QuartzCore.framework */; }; + 5BF0A8A316D8B3B600E19081 /* MFOConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A8A216D8B3B600E19081 /* MFOConstants.m */; }; + 5BF0A8A616D8B41E00E19081 /* MFOHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A8A516D8B41E00E19081 /* MFOHTTPClient.m */; }; + 5BF0A8AD16D8D47D00E19081 /* MFOToastView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF0A8AC16D8D47D00E19081 /* MFOToastView.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 5BF0A7F916D88DA700E19081 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5BF0A7B816D88DA600E19081 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 5BF0A7C016D88DA600E19081; + remoteInfo = MyFilesOnline; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 5B426C4C16DA4C9400054A22 /* MyFileInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyFileInfo.h; sourceTree = ""; }; + 5B426C4D16DA4C9400054A22 /* MyFileInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyFileInfo.m; sourceTree = ""; }; + 5B426C5816DA758B00054A22 /* MFOCoreDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOCoreDataManager.h; sourceTree = ""; }; + 5B426C5916DA758B00054A22 /* MFOCoreDataManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFOCoreDataManager.m; sourceTree = ""; }; + 5B426C6B16DAAA3400054A22 /* MFOFileDetailsCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOFileDetailsCell.h; sourceTree = ""; }; + 5B426C6C16DAAA3400054A22 /* MFOFileDetailsCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFOFileDetailsCell.m; sourceTree = ""; }; + 5B7A969D16D91D7500D9CB51 /* MyFilesOnline.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MyFilesOnline.xcdatamodel; sourceTree = ""; }; + 5B7A969F16D91DAB00D9CB51 /* MyDirectoryInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyDirectoryInfo.h; sourceTree = ""; }; + 5B7A96A016D91DAB00D9CB51 /* MyDirectoryInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyDirectoryInfo.m; sourceTree = ""; }; + 5B7A96A316D91DAB00D9CB51 /* MyFileTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyFileTypes.h; sourceTree = ""; }; + 5B7A96A416D91DAB00D9CB51 /* MyFileTypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyFileTypes.m; sourceTree = ""; }; + 5BD5C98816D94B6E00F8E2F8 /* MFOUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOUtility.h; sourceTree = ""; }; + 5BD5C98916D94B6E00F8E2F8 /* MFOUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFOUtility.m; sourceTree = ""; }; + 5BF0A7C116D88DA600E19081 /* MyFilesOnline.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MyFilesOnline.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 5BF0A7C516D88DA600E19081 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 5BF0A7C716D88DA600E19081 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 5BF0A7C916D88DA600E19081 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 5BF0A7CB16D88DA600E19081 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + 5BF0A7CF16D88DA600E19081 /* MyFilesOnline-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MyFilesOnline-Info.plist"; sourceTree = ""; }; + 5BF0A7D116D88DA600E19081 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 5BF0A7D316D88DA600E19081 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 5BF0A7D516D88DA600E19081 /* MyFilesOnline-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MyFilesOnline-Prefix.pch"; sourceTree = ""; }; + 5BF0A7D616D88DA600E19081 /* MFOAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MFOAppDelegate.h; sourceTree = ""; }; + 5BF0A7D716D88DA600E19081 /* MFOAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MFOAppDelegate.m; sourceTree = ""; }; + 5BF0A7D916D88DA600E19081 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; + 5BF0A7DB16D88DA600E19081 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; + 5BF0A7DD16D88DA600E19081 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + 5BF0A7F316D88DA700E19081 /* MyFilesOnlineTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MyFilesOnlineTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; + 5BF0A7F416D88DA700E19081 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; + 5BF0A7FD16D88DA700E19081 /* MyFilesOnlineTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MyFilesOnlineTests-Info.plist"; sourceTree = ""; }; + 5BF0A7FF16D88DA700E19081 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 5BF0A80116D88DA700E19081 /* MyFilesOnlineTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyFilesOnlineTests.h; sourceTree = ""; }; + 5BF0A80216D88DA700E19081 /* MyFilesOnlineTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyFilesOnlineTests.m; sourceTree = ""; }; + 5BF0A88616D8A20200E19081 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = InfoPlist.strings; sourceTree = ""; }; + 5BF0A88816D8A20200E19081 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = MainStoryboard_iPad.storyboard; sourceTree = ""; }; + 5BF0A88A16D8A20200E19081 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = MainStoryboard_iPhone.storyboard; sourceTree = ""; }; + 5BF0A89116D8A20600E19081 /* MFODetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFODetailViewController.h; sourceTree = ""; }; + 5BF0A89216D8A20600E19081 /* MFODetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFODetailViewController.m; sourceTree = ""; }; + 5BF0A89316D8A20600E19081 /* MFOMasterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOMasterViewController.h; sourceTree = ""; }; + 5BF0A89416D8A20600E19081 /* MFOMasterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFOMasterViewController.m; sourceTree = ""; }; + 5BF0A89C16D8A3A400E19081 /* MFORefreshControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFORefreshControl.h; sourceTree = ""; }; + 5BF0A89D16D8A3A400E19081 /* MFORefreshControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFORefreshControl.m; sourceTree = ""; }; + 5BF0A89F16D8A4B900E19081 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 5BF0A8A116D8B3B600E19081 /* MFOConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOConstants.h; sourceTree = ""; }; + 5BF0A8A216D8B3B600E19081 /* MFOConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFOConstants.m; sourceTree = ""; }; + 5BF0A8A416D8B41E00E19081 /* MFOHTTPClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOHTTPClient.h; sourceTree = ""; }; + 5BF0A8A516D8B41E00E19081 /* MFOHTTPClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFOHTTPClient.m; sourceTree = ""; }; + 5BF0A8AB16D8D47C00E19081 /* MFOToastView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFOToastView.h; sourceTree = ""; }; + 5BF0A8AC16D8D47D00E19081 /* MFOToastView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFOToastView.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 5BF0A7BE16D88DA600E19081 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 5BF0A8A016D8A4B900E19081 /* QuartzCore.framework in Frameworks */, + 5BF0A7C616D88DA600E19081 /* UIKit.framework in Frameworks */, + 5BF0A7C816D88DA600E19081 /* Foundation.framework in Frameworks */, + 5BF0A7CA16D88DA600E19081 /* CoreGraphics.framework in Frameworks */, + 5BF0A7CC16D88DA600E19081 /* CoreData.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5BF0A7EF16D88DA700E19081 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 5BF0A7F516D88DA700E19081 /* SenTestingKit.framework in Frameworks */, + 5BF0A7F616D88DA700E19081 /* UIKit.framework in Frameworks */, + 5BF0A7F716D88DA700E19081 /* Foundation.framework in Frameworks */, + 5BF0A7F816D88DA700E19081 /* CoreData.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 5BF0A7B616D88DA600E19081 = { + isa = PBXGroup; + children = ( + 5BF0A7CD16D88DA600E19081 /* MyFilesOnline */, + 5BF0A7FB16D88DA700E19081 /* MyFilesOnlineTests */, + 5BF0A7C416D88DA600E19081 /* Frameworks */, + 5BF0A7C216D88DA600E19081 /* Products */, + ); + sourceTree = ""; + }; + 5BF0A7C216D88DA600E19081 /* Products */ = { + isa = PBXGroup; + children = ( + 5BF0A7C116D88DA600E19081 /* MyFilesOnline.app */, + 5BF0A7F316D88DA700E19081 /* MyFilesOnlineTests.octest */, + ); + name = Products; + sourceTree = ""; + }; + 5BF0A7C416D88DA600E19081 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 5BF0A89F16D8A4B900E19081 /* QuartzCore.framework */, + 5BF0A7C516D88DA600E19081 /* UIKit.framework */, + 5BF0A7C716D88DA600E19081 /* Foundation.framework */, + 5BF0A7C916D88DA600E19081 /* CoreGraphics.framework */, + 5BF0A7CB16D88DA600E19081 /* CoreData.framework */, + 5BF0A7F416D88DA700E19081 /* SenTestingKit.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 5BF0A7CD16D88DA600E19081 /* MyFilesOnline */ = { + isa = PBXGroup; + children = ( + 5BF0A7D616D88DA600E19081 /* MFOAppDelegate.h */, + 5BF0A7D716D88DA600E19081 /* MFOAppDelegate.m */, + 5BF0A89016D8A20400E19081 /* view_controllers */, + 5BF0A87F16D8A20100E19081 /* classes */, + 5BF0A88016D8A20100E19081 /* custom_gui_components */, + 5BF0A88C16D8A20300E19081 /* model */, + 5BF0A88116D8A20200E19081 /* data */, + 5BF0A88416D8A20200E19081 /* storyboard */, + 5BF0A88B16D8A20200E19081 /* lib */, + 5BF0A88D16D8A20400E19081 /* resource */, + 5BF0A7CE16D88DA600E19081 /* Supporting Files */, + ); + path = MyFilesOnline; + sourceTree = ""; + }; + 5BF0A7CE16D88DA600E19081 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 5BF0A7CF16D88DA600E19081 /* MyFilesOnline-Info.plist */, + 5BF0A7D016D88DA600E19081 /* InfoPlist.strings */, + 5BF0A7D316D88DA600E19081 /* main.m */, + 5BF0A7D516D88DA600E19081 /* MyFilesOnline-Prefix.pch */, + 5BF0A7D916D88DA600E19081 /* Default.png */, + 5BF0A7DB16D88DA600E19081 /* Default@2x.png */, + 5BF0A7DD16D88DA600E19081 /* Default-568h@2x.png */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 5BF0A7FB16D88DA700E19081 /* MyFilesOnlineTests */ = { + isa = PBXGroup; + children = ( + 5BF0A80116D88DA700E19081 /* MyFilesOnlineTests.h */, + 5BF0A80216D88DA700E19081 /* MyFilesOnlineTests.m */, + 5BF0A7FC16D88DA700E19081 /* Supporting Files */, + ); + path = MyFilesOnlineTests; + sourceTree = ""; + }; + 5BF0A7FC16D88DA700E19081 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 5BF0A7FD16D88DA700E19081 /* MyFilesOnlineTests-Info.plist */, + 5BF0A7FE16D88DA700E19081 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 5BF0A87F16D8A20100E19081 /* classes */ = { + isa = PBXGroup; + children = ( + 5BF0A8A116D8B3B600E19081 /* MFOConstants.h */, + 5BF0A8A216D8B3B600E19081 /* MFOConstants.m */, + 5BF0A8A416D8B41E00E19081 /* MFOHTTPClient.h */, + 5BF0A8A516D8B41E00E19081 /* MFOHTTPClient.m */, + 5BD5C98816D94B6E00F8E2F8 /* MFOUtility.h */, + 5BD5C98916D94B6E00F8E2F8 /* MFOUtility.m */, + 5B426C5816DA758B00054A22 /* MFOCoreDataManager.h */, + 5B426C5916DA758B00054A22 /* MFOCoreDataManager.m */, + ); + path = classes; + sourceTree = ""; + }; + 5BF0A88016D8A20100E19081 /* custom_gui_components */ = { + isa = PBXGroup; + children = ( + 5BF0A8AB16D8D47C00E19081 /* MFOToastView.h */, + 5BF0A8AC16D8D47D00E19081 /* MFOToastView.m */, + 5BF0A89C16D8A3A400E19081 /* MFORefreshControl.h */, + 5BF0A89D16D8A3A400E19081 /* MFORefreshControl.m */, + 5B426C6B16DAAA3400054A22 /* MFOFileDetailsCell.h */, + 5B426C6C16DAAA3400054A22 /* MFOFileDetailsCell.m */, + ); + path = custom_gui_components; + sourceTree = ""; + }; + 5BF0A88116D8A20200E19081 /* data */ = { + isa = PBXGroup; + children = ( + 5B7A969C16D91D7500D9CB51 /* MyFilesOnline.xcdatamodeld */, + ); + path = data; + sourceTree = ""; + }; + 5BF0A88416D8A20200E19081 /* storyboard */ = { + isa = PBXGroup; + children = ( + 5BF0A88516D8A20200E19081 /* InfoPlist.strings */, + 5BF0A88716D8A20200E19081 /* MainStoryboard_iPad.storyboard */, + 5BF0A88916D8A20200E19081 /* MainStoryboard_iPhone.storyboard */, + ); + name = storyboard; + path = en.lproj; + sourceTree = ""; + }; + 5BF0A88B16D8A20200E19081 /* lib */ = { + isa = PBXGroup; + children = ( + ); + path = lib; + sourceTree = ""; + }; + 5BF0A88C16D8A20300E19081 /* model */ = { + isa = PBXGroup; + children = ( + 5B7A969F16D91DAB00D9CB51 /* MyDirectoryInfo.h */, + 5B7A96A016D91DAB00D9CB51 /* MyDirectoryInfo.m */, + 5B7A96A316D91DAB00D9CB51 /* MyFileTypes.h */, + 5B7A96A416D91DAB00D9CB51 /* MyFileTypes.m */, + 5B426C4C16DA4C9400054A22 /* MyFileInfo.h */, + 5B426C4D16DA4C9400054A22 /* MyFileInfo.m */, + ); + path = model; + sourceTree = ""; + }; + 5BF0A88D16D8A20400E19081 /* resource */ = { + isa = PBXGroup; + children = ( + 5BF0A88E16D8A20400E19081 /* images */, + ); + path = resource; + sourceTree = ""; + }; + 5BF0A88E16D8A20400E19081 /* images */ = { + isa = PBXGroup; + children = ( + ); + path = images; + sourceTree = ""; + }; + 5BF0A89016D8A20400E19081 /* view_controllers */ = { + isa = PBXGroup; + children = ( + 5BF0A89316D8A20600E19081 /* MFOMasterViewController.h */, + 5BF0A89416D8A20600E19081 /* MFOMasterViewController.m */, + 5BF0A89116D8A20600E19081 /* MFODetailViewController.h */, + 5BF0A89216D8A20600E19081 /* MFODetailViewController.m */, + ); + path = view_controllers; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 5BF0A7C016D88DA600E19081 /* MyFilesOnline */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5BF0A80616D88DA700E19081 /* Build configuration list for PBXNativeTarget "MyFilesOnline" */; + buildPhases = ( + 5BF0A7BD16D88DA600E19081 /* Sources */, + 5BF0A7BE16D88DA600E19081 /* Frameworks */, + 5BF0A7BF16D88DA600E19081 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MyFilesOnline; + productName = MyFilesOnline; + productReference = 5BF0A7C116D88DA600E19081 /* MyFilesOnline.app */; + productType = "com.apple.product-type.application"; + }; + 5BF0A7F216D88DA700E19081 /* MyFilesOnlineTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5BF0A80916D88DA700E19081 /* Build configuration list for PBXNativeTarget "MyFilesOnlineTests" */; + buildPhases = ( + 5BF0A7EE16D88DA700E19081 /* Sources */, + 5BF0A7EF16D88DA700E19081 /* Frameworks */, + 5BF0A7F016D88DA700E19081 /* Resources */, + 5BF0A7F116D88DA700E19081 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 5BF0A7FA16D88DA700E19081 /* PBXTargetDependency */, + ); + name = MyFilesOnlineTests; + productName = MyFilesOnlineTests; + productReference = 5BF0A7F316D88DA700E19081 /* MyFilesOnlineTests.octest */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 5BF0A7B816D88DA600E19081 /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = MFO; + LastUpgradeCheck = 0450; + ORGANIZATIONNAME = "Warif Akhand Rishi"; + }; + buildConfigurationList = 5BF0A7BB16D88DA600E19081 /* Build configuration list for PBXProject "MyFilesOnline" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 5BF0A7B616D88DA600E19081; + productRefGroup = 5BF0A7C216D88DA600E19081 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 5BF0A7C016D88DA600E19081 /* MyFilesOnline */, + 5BF0A7F216D88DA700E19081 /* MyFilesOnlineTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 5BF0A7BF16D88DA600E19081 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5BF0A7D216D88DA600E19081 /* InfoPlist.strings in Resources */, + 5BF0A7DA16D88DA600E19081 /* Default.png in Resources */, + 5BF0A7DC16D88DA600E19081 /* Default@2x.png in Resources */, + 5BF0A7DE16D88DA600E19081 /* Default-568h@2x.png in Resources */, + 5BF0A89616D8A20600E19081 /* InfoPlist.strings in Resources */, + 5BF0A89716D8A20600E19081 /* MainStoryboard_iPad.storyboard in Resources */, + 5BF0A89816D8A20600E19081 /* MainStoryboard_iPhone.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5BF0A7F016D88DA700E19081 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5BF0A80016D88DA700E19081 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 5BF0A7F116D88DA700E19081 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 5BF0A7BD16D88DA600E19081 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5BF0A7D416D88DA600E19081 /* main.m in Sources */, + 5BF0A7D816D88DA600E19081 /* MFOAppDelegate.m in Sources */, + 5BF0A89916D8A20600E19081 /* MFODetailViewController.m in Sources */, + 5BF0A89A16D8A20600E19081 /* MFOMasterViewController.m in Sources */, + 5BF0A89E16D8A3A400E19081 /* MFORefreshControl.m in Sources */, + 5BF0A8A316D8B3B600E19081 /* MFOConstants.m in Sources */, + 5BF0A8A616D8B41E00E19081 /* MFOHTTPClient.m in Sources */, + 5BF0A8AD16D8D47D00E19081 /* MFOToastView.m in Sources */, + 5B7A969E16D91D7500D9CB51 /* MyFilesOnline.xcdatamodeld in Sources */, + 5B7A96A516D91DAB00D9CB51 /* MyDirectoryInfo.m in Sources */, + 5B7A96A716D91DAB00D9CB51 /* MyFileTypes.m in Sources */, + 5BD5C98A16D94B6E00F8E2F8 /* MFOUtility.m in Sources */, + 5B426C4E16DA4C9400054A22 /* MyFileInfo.m in Sources */, + 5B426C5A16DA758B00054A22 /* MFOCoreDataManager.m in Sources */, + 5B426C6D16DAAA3400054A22 /* MFOFileDetailsCell.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5BF0A7EE16D88DA700E19081 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5BF0A80316D88DA700E19081 /* MyFilesOnlineTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 5BF0A7FA16D88DA700E19081 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 5BF0A7C016D88DA600E19081 /* MyFilesOnline */; + targetProxy = 5BF0A7F916D88DA700E19081 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 5BF0A7D016D88DA600E19081 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 5BF0A7D116D88DA600E19081 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 5BF0A7FE16D88DA700E19081 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 5BF0A7FF16D88DA700E19081 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 5BF0A88516D8A20200E19081 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 5BF0A88616D8A20200E19081 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 5BF0A88716D8A20200E19081 /* MainStoryboard_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 5BF0A88816D8A20200E19081 /* en */, + ); + name = MainStoryboard_iPad.storyboard; + sourceTree = ""; + }; + 5BF0A88916D8A20200E19081 /* MainStoryboard_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 5BF0A88A16D8A20200E19081 /* en */, + ); + name = MainStoryboard_iPhone.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 5BF0A80416D88DA700E19081 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 5BF0A80516D88DA700E19081 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 5BF0A80716D88DA700E19081 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "MyFilesOnline/MyFilesOnline-Prefix.pch"; + INFOPLIST_FILE = "MyFilesOnline/MyFilesOnline-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 5BF0A80816D88DA700E19081 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "MyFilesOnline/MyFilesOnline-Prefix.pch"; + INFOPLIST_FILE = "MyFilesOnline/MyFilesOnline-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 5BF0A80A16D88DA700E19081 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MyFilesOnline.app/MyFilesOnline"; + FRAMEWORK_SEARCH_PATHS = ( + "\"$(SDKROOT)/Developer/Library/Frameworks\"", + "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "MyFilesOnline/MyFilesOnline-Prefix.pch"; + INFOPLIST_FILE = "MyFilesOnlineTests/MyFilesOnlineTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = octest; + }; + name = Debug; + }; + 5BF0A80B16D88DA700E19081 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MyFilesOnline.app/MyFilesOnline"; + FRAMEWORK_SEARCH_PATHS = ( + "\"$(SDKROOT)/Developer/Library/Frameworks\"", + "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "MyFilesOnline/MyFilesOnline-Prefix.pch"; + INFOPLIST_FILE = "MyFilesOnlineTests/MyFilesOnlineTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = octest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 5BF0A7BB16D88DA600E19081 /* Build configuration list for PBXProject "MyFilesOnline" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5BF0A80416D88DA700E19081 /* Debug */, + 5BF0A80516D88DA700E19081 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 5BF0A80616D88DA700E19081 /* Build configuration list for PBXNativeTarget "MyFilesOnline" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5BF0A80716D88DA700E19081 /* Debug */, + 5BF0A80816D88DA700E19081 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 5BF0A80916D88DA700E19081 /* Build configuration list for PBXNativeTarget "MyFilesOnlineTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5BF0A80A16D88DA700E19081 /* Debug */, + 5BF0A80B16D88DA700E19081 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCVersionGroup section */ + 5B7A969C16D91D7500D9CB51 /* MyFilesOnline.xcdatamodeld */ = { + isa = XCVersionGroup; + children = ( + 5B7A969D16D91D7500D9CB51 /* MyFilesOnline.xcdatamodel */, + ); + currentVersion = 5B7A969D16D91D7500D9CB51 /* MyFilesOnline.xcdatamodel */; + path = MyFilesOnline.xcdatamodeld; + sourceTree = ""; + versionGroupType = wrapper.xcdatamodel; + }; +/* End XCVersionGroup section */ + }; + rootObject = 5BF0A7B816D88DA600E19081 /* Project object */; +} diff --git a/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..dd00f50 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.xcworkspace/xcuserdata/Rishi.xcuserdatad/UserInterfaceState.xcuserstate b/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.xcworkspace/xcuserdata/Rishi.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..b92ce44 Binary files /dev/null and b/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/project.xcworkspace/xcuserdata/Rishi.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcschemes/MyFilesOnline.xcscheme b/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcschemes/MyFilesOnline.xcscheme new file mode 100644 index 0000000..ec33dcb --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcschemes/MyFilesOnline.xcscheme @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcschemes/xcschememanagement.plist b/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..c28d325 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline.xcodeproj/xcuserdata/Rishi.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + MyFilesOnline.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 5BF0A7C016D88DA600E19081 + + primary + + + 5BF0A7F216D88DA700E19081 + + primary + + + + + diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/Default-568h@2x.png b/non-ARC/MyFilesOnline/MyFilesOnline/Default-568h@2x.png new file mode 100644 index 0000000..0891b7a Binary files /dev/null and b/non-ARC/MyFilesOnline/MyFilesOnline/Default-568h@2x.png differ diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/Default.png b/non-ARC/MyFilesOnline/MyFilesOnline/Default.png new file mode 100644 index 0000000..4c8ca6f Binary files /dev/null and b/non-ARC/MyFilesOnline/MyFilesOnline/Default.png differ diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/Default@2x.png b/non-ARC/MyFilesOnline/MyFilesOnline/Default@2x.png new file mode 100644 index 0000000..35b84cf Binary files /dev/null and b/non-ARC/MyFilesOnline/MyFilesOnline/Default@2x.png differ diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/MFOAppDelegate.h b/non-ARC/MyFilesOnline/MyFilesOnline/MFOAppDelegate.h new file mode 100644 index 0000000..d748c94 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/MFOAppDelegate.h @@ -0,0 +1,22 @@ +// +// MFOAppDelegate.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@interface MFOAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext; +@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel; +@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator; + +- (void)saveContext; +- (NSURL *)applicationDocumentsDirectory; + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/MFOAppDelegate.m b/non-ARC/MyFilesOnline/MyFilesOnline/MFOAppDelegate.m new file mode 100644 index 0000000..f8fcbc5 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/MFOAppDelegate.m @@ -0,0 +1,171 @@ +// +// MFOAppDelegate.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOAppDelegate.h" + +#import "MFOMasterViewController.h" + +@implementation MFOAppDelegate + +- (void)dealloc +{ + [_window release]; + [_managedObjectContext release]; + [_managedObjectModel release]; + [_persistentStoreCoordinator release]; + [super dealloc]; +} + +@synthesize managedObjectContext = _managedObjectContext; +@synthesize managedObjectModel = _managedObjectModel; +@synthesize persistentStoreCoordinator = _persistentStoreCoordinator; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { + UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController; + UINavigationController *navigationController = [splitViewController.viewControllers lastObject]; + splitViewController.delegate = (id)navigationController.topViewController; + + UINavigationController *masterNavigationController = splitViewController.viewControllers[0]; + MFOMasterViewController *controller = (MFOMasterViewController *)masterNavigationController.topViewController; + controller.managedObjectContext = self.managedObjectContext; + } else { + UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController; + MFOMasterViewController *controller = (MFOMasterViewController *)navigationController.topViewController; + controller.managedObjectContext = self.managedObjectContext; + } + + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application +{ + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application +{ + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + +- (void)applicationWillEnterForeground:(UIApplication *)application +{ + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application +{ + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + +- (void)applicationWillTerminate:(UIApplication *)application +{ + // Saves changes in the application's managed object context before the application terminates. + [self saveContext]; +} + +- (void)saveContext +{ + NSError *error = nil; + NSManagedObjectContext *managedObjectContext = self.managedObjectContext; + if (managedObjectContext != nil) { + if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error]) { + // Replace this implementation with code to handle the error appropriately. + // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + NSLog(@"Unresolved error %@, %@", error, [error userInfo]); + abort(); + } + } +} + +#pragma mark - Core Data stack + +// Returns the managed object context for the application. +// If the context doesn't already exist, it is created and bound to the persistent store coordinator for the application. +- (NSManagedObjectContext *)managedObjectContext +{ + if (_managedObjectContext != nil) { + return _managedObjectContext; + } + + NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; + if (coordinator != nil) { + _managedObjectContext = [[NSManagedObjectContext alloc] init]; + [_managedObjectContext setPersistentStoreCoordinator:coordinator]; + } + return _managedObjectContext; +} + +// Returns the managed object model for the application. +// If the model doesn't already exist, it is created from the application's model. +- (NSManagedObjectModel *)managedObjectModel +{ + if (_managedObjectModel != nil) { + return _managedObjectModel; + } + NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"MyFilesOnline" withExtension:@"momd"]; + _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; + return _managedObjectModel; +} + +// Returns the persistent store coordinator for the application. +// If the coordinator doesn't already exist, it is created and the application's store added to it. +- (NSPersistentStoreCoordinator *)persistentStoreCoordinator +{ + if (_persistentStoreCoordinator != nil) { + return _persistentStoreCoordinator; + } + + NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"MyFilesOnline.sqlite"]; + + NSError *error = nil; + _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; + if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) { + /* + Replace this implementation with code to handle the error appropriately. + + abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + + Typical reasons for an error here include: + * The persistent store is not accessible; + * The schema for the persistent store is incompatible with current managed object model. + Check the error message to determine what the actual problem was. + + + If the persistent store is not accessible, there is typically something wrong with the file path. Often, a file URL is pointing into the application's resources directory instead of a writeable directory. + + If you encounter schema incompatibility errors during development, you can reduce their frequency by: + * Simply deleting the existing store: + [[NSFileManager defaultManager] removeItemAtURL:storeURL error:nil] + + * Performing automatic lightweight migration by passing the following dictionary as the options parameter: + @{NSMigratePersistentStoresAutomaticallyOption:@YES, NSInferMappingModelAutomaticallyOption:@YES} + + Lightweight migration will only work for a limited set of schema changes; consult "Core Data Model Versioning and Data Migration Programming Guide" for details. + + */ + NSLog(@"Unresolved error %@, %@", error, [error userInfo]); + abort(); + } + + return _persistentStoreCoordinator; +} + +#pragma mark - Application's Documents directory + +// Returns the URL to the application's Documents directory. +- (NSURL *)applicationDocumentsDirectory +{ + return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; +} + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/MFODetailViewController.h b/non-ARC/MyFilesOnline/MyFilesOnline/MFODetailViewController.h new file mode 100644 index 0000000..f48c75a --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/MFODetailViewController.h @@ -0,0 +1,17 @@ +// +// MFODetailViewController.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@interface MFODetailViewController : UIViewController + +@property (strong, nonatomic) id detailItem; + +@property (strong, nonatomic) IBOutlet UILabel *detailDescriptionLabel; + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/MFODetailViewController.m b/non-ARC/MyFilesOnline/MyFilesOnline/MFODetailViewController.m new file mode 100644 index 0000000..a55466b --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/MFODetailViewController.m @@ -0,0 +1,81 @@ +// +// MFODetailViewController.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFODetailViewController.h" + +@interface MFODetailViewController () +@property (strong, nonatomic) UIPopoverController *masterPopoverController; +- (void)configureView; +@end + +@implementation MFODetailViewController + +- (void)dealloc +{ + [_detailItem release]; + [_detailDescriptionLabel release]; + [_masterPopoverController release]; + [super dealloc]; +} + +#pragma mark - Managing the detail item + +- (void)setDetailItem:(id)newDetailItem +{ + if (_detailItem != newDetailItem) { + [_detailItem release]; + _detailItem = [newDetailItem retain]; + + // Update the view. + [self configureView]; + } + + if (self.masterPopoverController != nil) { + [self.masterPopoverController dismissPopoverAnimated:YES]; + } +} + +- (void)configureView +{ + // Update the user interface for the detail item. + + if (self.detailItem) { + self.detailDescriptionLabel.text = [[self.detailItem valueForKey:@"timeStamp"] description]; + } +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + [self configureView]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Split view + +- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController +{ + barButtonItem.title = NSLocalizedString(@"Master", @"Master"); + [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES]; + self.masterPopoverController = popoverController; +} + +- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem +{ + // Called when the view is shown again in the split view, invalidating the button and popover controller. + [self.navigationItem setLeftBarButtonItem:nil animated:YES]; + self.masterPopoverController = nil; +} + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/MFOMasterViewController.h b/non-ARC/MyFilesOnline/MyFilesOnline/MFOMasterViewController.h new file mode 100644 index 0000000..dbf6893 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/MFOMasterViewController.h @@ -0,0 +1,22 @@ +// +// MFOMasterViewController.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@class MFODetailViewController; + +#import + +@interface MFOMasterViewController : UITableViewController + +@property (strong, nonatomic) MFODetailViewController *detailViewController; + +@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController; +@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext; + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/MFOMasterViewController.m b/non-ARC/MyFilesOnline/MyFilesOnline/MFOMasterViewController.m new file mode 100644 index 0000000..0f52a2c --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/MFOMasterViewController.m @@ -0,0 +1,243 @@ +// +// MFOMasterViewController.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOMasterViewController.h" + +#import "MFODetailViewController.h" + +@interface MFOMasterViewController () +- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath; +@end + +@implementation MFOMasterViewController + +- (void)awakeFromNib +{ + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { + self.clearsSelectionOnViewWillAppear = NO; + self.contentSizeForViewInPopover = CGSizeMake(320.0, 600.0); + } + [super awakeFromNib]; +} + +- (void)dealloc +{ + [_detailViewController release]; + [_fetchedResultsController release]; + [_managedObjectContext release]; + [super dealloc]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.navigationItem.leftBarButtonItem = self.editButtonItem; + + UIBarButtonItem *addButton = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)] autorelease]; + self.navigationItem.rightBarButtonItem = addButton; + self.detailViewController = (MFODetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)insertNewObject:(id)sender +{ + NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; + NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity]; + NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context]; + + // If appropriate, configure the new managed object. + // Normally you should use accessor methods, but using KVC here avoids the need to add a custom class to the template. + [newManagedObject setValue:[NSDate date] forKey:@"timeStamp"]; + + // Save the context. + NSError *error = nil; + if (![context save:&error]) { + // Replace this implementation with code to handle the error appropriately. + // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + NSLog(@"Unresolved error %@, %@", error, [error userInfo]); + abort(); + } +} + +#pragma mark - Table View + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return [[self.fetchedResultsController sections] count]; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + id sectionInfo = [self.fetchedResultsController sections][section]; + return [sectionInfo numberOfObjects]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; + [self configureCell:cell atIndexPath:indexPath]; + return cell; +} + +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath +{ + // Return NO if you do not want the specified item to be editable. + return YES; +} + +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (editingStyle == UITableViewCellEditingStyleDelete) { + NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; + [context deleteObject:[self.fetchedResultsController objectAtIndexPath:indexPath]]; + + NSError *error = nil; + if (![context save:&error]) { + // Replace this implementation with code to handle the error appropriately. + // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + NSLog(@"Unresolved error %@, %@", error, [error userInfo]); + abort(); + } + } +} + +- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath +{ + // The table view should not be re-orderable. + return NO; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { + NSManagedObject *object = [[self fetchedResultsController] objectAtIndexPath:indexPath]; + self.detailViewController.detailItem = object; + } +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender +{ + if ([[segue identifier] isEqualToString:@"showDetail"]) { + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + NSManagedObject *object = [[self fetchedResultsController] objectAtIndexPath:indexPath]; + [[segue destinationViewController] setDetailItem:object]; + } +} + +#pragma mark - Fetched results controller + +- (NSFetchedResultsController *)fetchedResultsController +{ + if (_fetchedResultsController != nil) { + return _fetchedResultsController; + } + + NSFetchRequest *fetchRequest = [[[NSFetchRequest alloc] init] autorelease]; + // Edit the entity name as appropriate. + NSEntityDescription *entity = [NSEntityDescription entityForName:@"Event" inManagedObjectContext:self.managedObjectContext]; + [fetchRequest setEntity:entity]; + + // Set the batch size to a suitable number. + [fetchRequest setFetchBatchSize:20]; + + // Edit the sort key as appropriate. + NSSortDescriptor *sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"timeStamp" ascending:NO] autorelease]; + NSArray *sortDescriptors = @[sortDescriptor]; + + [fetchRequest setSortDescriptors:sortDescriptors]; + + // Edit the section name key path and cache name if appropriate. + // nil for section name key path means "no sections". + NSFetchedResultsController *aFetchedResultsController = [[[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:self.managedObjectContext sectionNameKeyPath:nil cacheName:@"Master"] autorelease]; + aFetchedResultsController.delegate = self; + self.fetchedResultsController = aFetchedResultsController; + + NSError *error = nil; + if (![self.fetchedResultsController performFetch:&error]) { + // Replace this implementation with code to handle the error appropriately. + // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + NSLog(@"Unresolved error %@, %@", error, [error userInfo]); + abort(); + } + + return _fetchedResultsController; +} + +- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller +{ + [self.tableView beginUpdates]; +} + +- (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id )sectionInfo + atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type +{ + switch(type) { + case NSFetchedResultsChangeInsert: + [self.tableView insertSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationFade]; + break; + + case NSFetchedResultsChangeDelete: + [self.tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationFade]; + break; + } +} + +- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject + atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type + newIndexPath:(NSIndexPath *)newIndexPath +{ + UITableView *tableView = self.tableView; + + switch(type) { + case NSFetchedResultsChangeInsert: + [tableView insertRowsAtIndexPaths:@[newIndexPath] withRowAnimation:UITableViewRowAnimationFade]; + break; + + case NSFetchedResultsChangeDelete: + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; + break; + + case NSFetchedResultsChangeUpdate: + [self configureCell:[tableView cellForRowAtIndexPath:indexPath] atIndexPath:indexPath]; + break; + + case NSFetchedResultsChangeMove: + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; + [tableView insertRowsAtIndexPaths:@[newIndexPath] withRowAnimation:UITableViewRowAnimationFade]; + break; + } +} + +- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller +{ + [self.tableView endUpdates]; +} + +/* +// Implementing the above methods to update the table view in response to individual changes may have performance implications if a large number of changes are made simultaneously. If this proves to be an issue, you can instead just implement controllerDidChangeContent: which notifies the delegate that all section and object changes have been processed. + + - (void)controllerDidChangeContent:(NSFetchedResultsController *)controller +{ + // In the simplest, most efficient, case, reload the table view. + [self.tableView reloadData]; +} + */ + +- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath +{ + NSManagedObject *object = [self.fetchedResultsController objectAtIndexPath:indexPath]; + cell.textLabel.text = [[object valueForKey:@"timeStamp"] description]; +} + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline-Info.plist b/non-ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline-Info.plist new file mode 100644 index 0000000..601cdb4 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline-Info.plist @@ -0,0 +1,51 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.war.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard_iPhone + UIMainStoryboardFile~ipad + MainStoryboard_iPad + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarStyle + UIStatusBarStyleBlackTranslucent + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline-Prefix.pch b/non-ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline-Prefix.pch new file mode 100644 index 0000000..267900d --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline-Prefix.pch @@ -0,0 +1,15 @@ +// +// Prefix header for all source files of the 'MyFilesOnline' target in the 'MyFilesOnline' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import + #import +#endif diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline.xcdatamodeld/.xccurrentversion b/non-ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline.xcdatamodeld/.xccurrentversion new file mode 100644 index 0000000..ad0ce2c --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline.xcdatamodeld/.xccurrentversion @@ -0,0 +1,8 @@ + + + + + _XCCurrentVersionName + MyFilesOnline.xcdatamodel + + diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline.xcdatamodeld/MyFilesOnline.xcdatamodel/contents b/non-ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline.xcdatamodeld/MyFilesOnline.xcdatamodel/contents new file mode 100644 index 0000000..75b533a --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/MyFilesOnline.xcdatamodeld/MyFilesOnline.xcdatamodel/contents @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOConstants.h b/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOConstants.h new file mode 100644 index 0000000..648307b --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOConstants.h @@ -0,0 +1,12 @@ +// +// MFOConstants.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + + +extern NSString * const MFO_URL; + +extern int const FETCH_BATCH_SIZE; \ No newline at end of file diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOConstants.m b/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOConstants.m new file mode 100644 index 0000000..bdfd9bb --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOConstants.m @@ -0,0 +1,14 @@ +// +// MFOConstants.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOConstants.h" + + +NSString * const MFO_URL = @"https://gist.github.com/raw/4680060/aac6d818e7103edfe721e719b1512f707bcfb478/sample.json"; + +int const FETCH_BATCH_SIZE = 20; \ No newline at end of file diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOCoreDataManager.h b/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOCoreDataManager.h new file mode 100644 index 0000000..d4ab64d --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOCoreDataManager.h @@ -0,0 +1,22 @@ +// +// MFOCoreDataManager.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/24/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@class MyFileTypes; +@class MyDirectoryInfo; + +@interface MFOCoreDataManager : NSObject + +@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController; + +- (void)populateDatabaseWithJSON:(NSDictionary*)dictionary; +- (void)clearDatabase; +- (MyDirectoryInfo*)getDirectoryInfoFromDatabase; + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOCoreDataManager.m b/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOCoreDataManager.m new file mode 100644 index 0000000..d79c4ce --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOCoreDataManager.m @@ -0,0 +1,134 @@ +// +// MFOCoreDataManager.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/24/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOCoreDataManager.h" +#import "MyDirectoryInfo.h" +#import "MyFileTypes.h" +#import "MyFileInfo.h" +#import "MFOUtility.h" +#import "MFOConstants.h" + +@implementation MFOCoreDataManager + +- (void)populateDatabaseWithJSON:(NSDictionary*)dictionary +{ + NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; + + MyDirectoryInfo *myDirectoryInfo = [NSEntityDescription insertNewObjectForEntityForName:@"MyDirectoryInfo"inManagedObjectContext:context]; + + myDirectoryInfo.availableSpace = [dictionary valueForKeyPath:@"availableSpace"]; + myDirectoryInfo.last_rev_id = [dictionary valueForKeyPath:@"last_rev_id"]; + myDirectoryInfo.mode = [dictionary valueForKeyPath:@"mode"]; + myDirectoryInfo.my_files_count = [NSNumber numberWithInt:[[dictionary valueForKeyPath:@"my_files.content"] count]]; + myDirectoryInfo.pendingRequests = [dictionary valueForKeyPath:@"pendingRequests"]; + myDirectoryInfo.rev_id = [dictionary valueForKeyPath:@"rev_id"]; + myDirectoryInfo.shared_files_count = [NSNumber numberWithInt:[[dictionary valueForKeyPath:@"shared_files.content"] count]]; + myDirectoryInfo.totalSpace = [dictionary valueForKeyPath:@"totalSpace"]; + myDirectoryInfo.usedSpace = [dictionary valueForKeyPath:@"usedSpace"]; + + NSDictionary *fileType = [dictionary valueForKeyPath:@"my_files"]; + MyFileTypes *myFileType = [self getMyFileTypeFormDictionary:fileType andContext:context]; + myFileType.directoryInfo = myDirectoryInfo; + + NSDictionary *fileTypeShared = [dictionary valueForKeyPath:@"shared_files"]; + MyFileTypes *myFileTypeShared = [self getMyFileTypeFormDictionary:fileTypeShared andContext:context]; + myFileTypeShared.directoryInfo = myDirectoryInfo; + + myDirectoryInfo.fileTypes = [[NSSet alloc] initWithObjects:myFileType, myFileTypeShared, nil]; + + NSError *error; + if (![context save:&error]) { + NSLog(@"Whoops, couldn't save: %@", [error localizedDescription]); + } +} + +- (MyFileTypes*)getMyFileTypeFormDictionary:(NSDictionary*)fileType andContext:(NSManagedObjectContext*)context +{ + MyFileTypes *myFileTypes = [NSEntityDescription insertNewObjectForEntityForName:@"MyFileType" inManagedObjectContext:context]; + + myFileTypes.id = [fileType valueForKeyPath:@"id"]; + myFileTypes.name = [fileType valueForKeyPath:@"name"]; + + NSMutableArray *myFiles = [[NSMutableArray alloc] init]; + + for (NSDictionary *contentDictionary in [fileType valueForKeyPath:@"content"]) + { + MyFileInfo *fileInfo = [NSEntityDescription insertNewObjectForEntityForName:@"MyFileInfo" inManagedObjectContext:context]; + + fileInfo.created_date = [MFOUtility getDateFromString:[contentDictionary valueForKeyPath:@"created_date"]]; + fileInfo.is_shared = [NSNumber numberWithBool:[[contentDictionary valueForKeyPath:@"is_shared"] boolValue]]; + fileInfo.item_id = [contentDictionary valueForKeyPath:@"item_id"]; + fileInfo.last_updated_by = [contentDictionary valueForKeyPath:@"last_updated_by"]; + fileInfo.last_updated_date = [MFOUtility getDateFromString:[contentDictionary valueForKeyPath:@"last_updated_date"]]; + fileInfo.link = [contentDictionary valueForKeyPath:@"link"]; + fileInfo.mime_type = [contentDictionary valueForKeyPath:@"mime_type"]; + fileInfo.name = [contentDictionary valueForKeyPath:@"name"]; + id parentId = [contentDictionary valueForKeyPath:@"parent_id"]; + fileInfo.parent_id = ([parentId isKindOfClass:[NSNull class]]) ? nil : parentId; + fileInfo.path = [contentDictionary valueForKeyPath:@"path"]; + fileInfo.path_by_id = [contentDictionary valueForKeyPath:@"path_by_id"]; + fileInfo.share_id = [contentDictionary valueForKeyPath:@"share_id"]; + id shareLevel = [contentDictionary valueForKeyPath:@"share_level"]; + fileInfo.share_level = ([shareLevel isKindOfClass:[NSNumber class]]) ? shareLevel : nil; + fileInfo.shared_by = [contentDictionary valueForKeyPath:@"shared_by"]; + fileInfo.shared_date = [MFOUtility getDateFromString:[contentDictionary valueForKeyPath:@"shared_date"]]; + fileInfo.size = [contentDictionary valueForKeyPath:@"size"]; + fileInfo.status = [contentDictionary valueForKeyPath:@"status"]; + fileInfo.type = [contentDictionary valueForKeyPath:@"type"]; + fileInfo.user_id = [contentDictionary valueForKeyPath:@"user_id"]; + fileInfo.parentFileTypes = myFileTypes; + + [myFiles addObject:fileInfo]; + } + + myFileTypes.fileInfo = [[NSSet alloc] initWithArray:myFiles]; + [myFiles release]; + + return myFileTypes; +} + +- (void)clearDatabase +{ + //Erase the persistent store from coordinator and also file manager. + NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; + NSPersistentStore *store = [context.persistentStoreCoordinator.persistentStores lastObject]; + NSError *error = nil; + NSURL *storeURL = store.URL; + [context.persistentStoreCoordinator removePersistentStore:store error:&error]; + [[NSFileManager defaultManager] removeItemAtURL:storeURL error:&error]; + + //Make new persistent store for future saves + if (![context.persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) + { + NSLog(@"Database clear error"); + } +} + +- (MyDirectoryInfo*)getDirectoryInfoFromDatabase +{ + NSFetchRequest *fetchRequest = [[[NSFetchRequest alloc] init] autorelease]; + // Edit the entity name as appropriate. + NSEntityDescription *entity = [NSEntityDescription entityForName:@"MyDirectoryInfo" inManagedObjectContext:[self.fetchedResultsController managedObjectContext]]; + [fetchRequest setEntity:entity]; + + // Set the batch size to a suitable number. + [fetchRequest setFetchBatchSize:FETCH_BATCH_SIZE]; + + NSError *error; + + NSArray *fetchedObjects = [[self.fetchedResultsController managedObjectContext] executeFetchRequest:fetchRequest error:&error]; + + MyDirectoryInfo *directoryInfo = nil; + + for (MyDirectoryInfo *myDirectoryInfo in fetchedObjects) + directoryInfo = myDirectoryInfo; + + return directoryInfo; +} + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOHTTPClient.h b/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOHTTPClient.h new file mode 100644 index 0000000..97c98b5 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOHTTPClient.h @@ -0,0 +1,30 @@ +// +// MFOHTTPClient.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@protocol HTTPClientDelegate; + +@interface MFOHTTPClient : NSObject + +- (id)initWithURL:(NSURL*)URL andDelegate:(id)delegate; + +@end + + +@protocol HTTPClientDelegate + +@required +- (void)HTTPClientDidReceiveData:(NSData*)data; + +@optional +- (void)HTTPClientDidReceiveEmpty; +- (void)HTTPClientDidTimeOut; +- (void)HTTPClientDownloadError:(NSString*)errorMessage; + +@end \ No newline at end of file diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOHTTPClient.m b/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOHTTPClient.m new file mode 100644 index 0000000..7bfcea5 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOHTTPClient.m @@ -0,0 +1,39 @@ +// +// MFOHTTPClient.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOHTTPClient.h" + +@implementation MFOHTTPClient + +- (id)initWithURL:(NSURL*)URL andDelegate:(id)delegate +{ + if (self = [super init]) + { + NSURLRequest *request = [NSURLRequest requestWithURL:URL]; + + // !!!: sendAsynchronousRequest:queue:completionHandler: sends a request asynchronously (i.e., in the background, not blocking the main thread). When the response comes back, the handler block is dispatched to the queue specified in the queue. + + [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) + { + if ([data length] > 0 && error == nil && [delegate respondsToSelector:@selector(HTTPClientDidReceiveData:)]) + [delegate HTTPClientDidReceiveData:data]; + else if ([data length] == 0 && error == nil && [delegate respondsToSelector:@selector(HTTPClientDidReceiveEmpty)]) + [delegate HTTPClientDidReceiveEmpty]; + else if (error != nil && error.code == NSURLErrorTimedOut && [delegate respondsToSelector:@selector(HTTPClientDidTimeOut)]) + [delegate HTTPClientDidTimeOut]; + else if (error != nil && [delegate respondsToSelector:@selector(HTTPClientDownloadError:)]) + [delegate HTTPClientDownloadError:[error localizedDescription]]; + }]; + } + + return self; +} + + + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOUtility.h b/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOUtility.h new file mode 100644 index 0000000..fdfca78 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOUtility.h @@ -0,0 +1,18 @@ +// +// MFOUtility.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/24/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@interface MFOUtility : NSObject + ++ (NSString*)convertbyteToKB_MB:(long long)byte; ++ (NSDictionary*)getJSONDictionnaryFromData:(NSData*)data; ++ (NSDate*)getDateFromString:(NSString*)dateString; ++ (NSString*)getStringFromDate:(NSDate*)date; + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOUtility.m b/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOUtility.m new file mode 100644 index 0000000..415275a --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/classes/MFOUtility.m @@ -0,0 +1,65 @@ +// +// MFOUtility.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/24/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOUtility.h" + +@implementation MFOUtility + ++ (NSString*)convertbyteToKB_MB:(long long)byte +{ + NSString *retSize = [NSString stringWithFormat:@"%lld bytes",byte]; + float fByte = byte; + + if (byte > 1024) + { + //Kilobytes + fByte = fByte / 1024; + retSize = [NSString stringWithFormat:@"%.1f KB",fByte]; + } + + if (fByte > 1024) + { + //Megabytes + fByte = fByte / 1024; + retSize = [NSString stringWithFormat:@"%.1f MB",fByte]; + } + + if (fByte > 1024) + { + //GB + fByte = fByte / 1024; + retSize = [NSString stringWithFormat:@"%.1f GB",fByte]; + } + + return retSize; +} + ++ (NSDictionary*)getJSONDictionnaryFromData:(NSData*)data +{ + NSError *jsonError; + return [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError]; +} + ++ (NSDate*)getDateFromString:(NSString*)dateString +{ + NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; + return [dateFormatter dateFromString:dateString]; +} + ++ (NSString*)getStringFromDate:(NSDate*)date +{ + NSDateFormatter *format = [[NSDateFormatter alloc] init]; + [format setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; + NSString *retStr = [format stringFromDate:date]; + [format release]; + + return retStr; +} + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOFileDetailsCell.h b/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOFileDetailsCell.h new file mode 100644 index 0000000..02a47d1 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOFileDetailsCell.h @@ -0,0 +1,24 @@ +// +// MFOFileDetailsCell.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/25/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@interface MFOFileDetailsCell : UITableViewCell + +@property (nonatomic, strong) IBOutlet UILabel *nameLabel; +@property (nonatomic, strong) IBOutlet UILabel *lastUpdatedByLabel; +@property (nonatomic, strong) IBOutlet UILabel *statusLabel; +@property (nonatomic, strong) IBOutlet UILabel *sharedByLabel; +@property (nonatomic, strong) IBOutlet UILabel *pathLabel; +@property (nonatomic, strong) IBOutlet UILabel *linkLabel; +@property (nonatomic, strong) IBOutlet UILabel *updateDateLabel; +@property (nonatomic, strong) IBOutlet UILabel *createDateLabel; +@property (nonatomic, strong) IBOutlet UILabel *shareDateLabel; + + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOFileDetailsCell.m b/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOFileDetailsCell.m new file mode 100644 index 0000000..c7f7a56 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOFileDetailsCell.m @@ -0,0 +1,39 @@ +// +// MFOFileDetailsCell.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/25/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOFileDetailsCell.h" + +@implementation MFOFileDetailsCell + +@synthesize nameLabel; +@synthesize lastUpdatedByLabel; +@synthesize statusLabel; +@synthesize sharedByLabel; +@synthesize pathLabel; +@synthesize linkLabel; +@synthesize updateDateLabel; +@synthesize createDateLabel; +@synthesize shareDateLabel; + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) { + // Initialization code + } + return self; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFORefreshControl.h b/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFORefreshControl.h new file mode 100644 index 0000000..f5773ef --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFORefreshControl.h @@ -0,0 +1,44 @@ +// +// MFORefreshControl.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import +#import + +@interface MFORefreshControl : UIControl +{ + CAShapeLayer *_shapeLayer; + CAShapeLayer *_arrowLayer; + CAShapeLayer *_highlightLayer; + UIView *_activity; + BOOL _refreshing; + BOOL _canRefresh; + BOOL _ignoreInset; + BOOL _ignoreOffset; + BOOL _didSetInset; + BOOL _hasSectionHeaders; + CGFloat _lastOffset; +} + +@property (nonatomic, readonly) BOOL refreshing; +@property (nonatomic, strong) UIColor *tintColor; +@property (nonatomic, assign) UIActivityIndicatorViewStyle activityIndicatorViewStyle; +@property (nonatomic, strong) UIColor *activityIndicatorViewColor; // iOS5 or more + +- (id)initInScrollView:(UIScrollView *)scrollView; + +// use custom activity indicator +- (id)initInScrollView:(UIScrollView *)scrollView activityIndicatorView:(UIView *)activity; + +// Tells the control that a refresh operation was started programmatically +- (void)beginRefreshing; + +// Tells the control the refresh operation has ended +- (void)endRefreshing; + + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFORefreshControl.m b/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFORefreshControl.m new file mode 100644 index 0000000..66877c5 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFORefreshControl.m @@ -0,0 +1,462 @@ +// +// MFORefreshControl.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFORefreshControl.h" + +#define kTotalViewHeight 400 +#define kOpenedViewHeight 44 +#define kMinTopPadding 9 +#define kMaxTopPadding 5 +#define kMinTopRadius 12.5 +#define kMaxTopRadius 16 +#define kMinBottomRadius 3 +#define kMaxBottomRadius 16 +#define kMinBottomPadding 4 +#define kMaxBottomPadding 6 +#define kMinArrowSize 2 +#define kMaxArrowSize 3 +#define kMinArrowRadius 5 +#define kMaxArrowRadius 7 +#define kMaxDistance 53 + + +@interface MFORefreshControl () + +@property (nonatomic, readwrite) BOOL refreshing; +@property (nonatomic, assign) UIScrollView *scrollView; +@property (nonatomic, assign) UIEdgeInsets originalContentInset; + +@end + + +@implementation MFORefreshControl + +@synthesize refreshing = _refreshing; +@synthesize tintColor = _tintColor; + +@synthesize scrollView = _scrollView; +@synthesize originalContentInset = _originalContentInset; + +static inline CGFloat lerp(CGFloat a, CGFloat b, CGFloat p) +{ + return a + (b - a) * p; +} + +- (id)initInScrollView:(UIScrollView *)scrollView { + return [self initInScrollView:scrollView activityIndicatorView:nil]; +} + +- (id)initInScrollView:(UIScrollView *)scrollView activityIndicatorView:(UIView *)activity +{ + self = [super initWithFrame:CGRectMake(0, -(kTotalViewHeight /*+ scrollView.contentInset.top*/), scrollView.frame.size.width, kTotalViewHeight)]; + + if (self) { + self.scrollView = scrollView; + self.originalContentInset = scrollView.contentInset; + + self.autoresizingMask = UIViewAutoresizingFlexibleWidth; + [scrollView addSubview:self]; + [scrollView addObserver:self forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionNew context:nil]; + [scrollView addObserver:self forKeyPath:@"contentInset" options:NSKeyValueObservingOptionNew context:nil]; + + _activity = activity ? activity : [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; + _activity.center = CGPointMake(floor(self.frame.size.width / 2), floor(self.frame.size.height / 2)); + _activity.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; + _activity.alpha = 0; + if ([_activity respondsToSelector:@selector(startAnimating)]) { + [(UIActivityIndicatorView *)_activity startAnimating]; + } + [self addSubview:_activity]; + + _refreshing = NO; + _canRefresh = YES; + _ignoreInset = NO; + _ignoreOffset = NO; + _didSetInset = NO; + _hasSectionHeaders = NO; + _tintColor = [UIColor colorWithRed:155.0 / 255.0 green:162.0 / 255.0 blue:172.0 / 255.0 alpha:1.0]; + + _shapeLayer = [CAShapeLayer layer]; + _shapeLayer.fillColor = [_tintColor CGColor]; + _shapeLayer.strokeColor = [[[UIColor darkGrayColor] colorWithAlphaComponent:0.5] CGColor]; + _shapeLayer.lineWidth = 0.5; + _shapeLayer.shadowColor = [[UIColor blackColor] CGColor]; + _shapeLayer.shadowOffset = CGSizeMake(0, 1); + _shapeLayer.shadowOpacity = 0.4; + _shapeLayer.shadowRadius = 0.5; + [self.layer addSublayer:_shapeLayer]; + + _arrowLayer = [CAShapeLayer layer]; + _arrowLayer.strokeColor = [[[UIColor darkGrayColor] colorWithAlphaComponent:0.5] CGColor]; + _arrowLayer.lineWidth = 0.5; + _arrowLayer.fillColor = [[UIColor whiteColor] CGColor]; + [_shapeLayer addSublayer:_arrowLayer]; + + _highlightLayer = [CAShapeLayer layer]; + _highlightLayer.fillColor = [[[UIColor whiteColor] colorWithAlphaComponent:0.2] CGColor]; + [_shapeLayer addSublayer:_highlightLayer]; + } + return self; +} + +- (void)dealloc +{ + [super dealloc]; + [self.scrollView removeObserver:self forKeyPath:@"contentOffset"]; + [self.scrollView removeObserver:self forKeyPath:@"contentInset"]; + self.scrollView = nil; +} + +- (void)setEnabled:(BOOL)enabled +{ + super.enabled = enabled; + _shapeLayer.hidden = !self.enabled; +} + +- (void)willMoveToSuperview:(UIView *)newSuperview +{ + [super willMoveToSuperview:newSuperview]; + if (!newSuperview) { + [self.scrollView removeObserver:self forKeyPath:@"contentOffset"]; + [self.scrollView removeObserver:self forKeyPath:@"contentInset"]; + self.scrollView = nil; + } +} + +- (void)setTintColor:(UIColor *)tintColor +{ + _tintColor = tintColor; + _shapeLayer.fillColor = [_tintColor CGColor]; +} + +- (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle +{ + if ([_activity isKindOfClass:[UIActivityIndicatorView class]]) { + [(UIActivityIndicatorView *)_activity setActivityIndicatorViewStyle:activityIndicatorViewStyle]; + } +} + +- (UIActivityIndicatorViewStyle)activityIndicatorViewStyle +{ + if ([_activity isKindOfClass:[UIActivityIndicatorView class]]) { + return [(UIActivityIndicatorView *)_activity activityIndicatorViewStyle]; + } + return 0; +} + +- (void)setActivityIndicatorViewColor:(UIColor *)activityIndicatorViewColor +{ + if ([_activity isKindOfClass:[UIActivityIndicatorView class]] && [_activity respondsToSelector:@selector(setColor:)]) { + [(UIActivityIndicatorView *)_activity setColor:activityIndicatorViewColor]; + } +} + +- (UIColor *)activityIndicatorViewColor +{ + if ([_activity isKindOfClass:[UIActivityIndicatorView class]] && [_activity respondsToSelector:@selector(color)]) { + return [(UIActivityIndicatorView *)_activity color]; + } + return nil; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + if ([keyPath isEqualToString:@"contentInset"]) { + if (!_ignoreInset) { + self.originalContentInset = [[change objectForKey:@"new"] UIEdgeInsetsValue]; + self.frame = CGRectMake(0, -(kTotalViewHeight /*+ self.scrollView.contentInset.top*/), self.scrollView.frame.size.width, kTotalViewHeight); + } + return; + } + + if (!self.enabled || _ignoreOffset) { + return; + } + + CGFloat offset = [[change objectForKey:@"new"] CGPointValue].y + self.originalContentInset.top; + + //Fixed bug when scroll up. Date: 23 Feb 2013 + if (offset > 0) + return; + + if (_refreshing) { + if (offset != 0) { + // Keep thing pinned at the top + + [CATransaction begin]; + [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; + _shapeLayer.position = CGPointMake(0, kMaxDistance + offset + kOpenedViewHeight); + [CATransaction commit]; + + _activity.center = CGPointMake(floor(self.frame.size.width / 2), MIN(offset + self.frame.size.height + floor(kOpenedViewHeight / 2), self.frame.size.height - kOpenedViewHeight/ 2)); + + _ignoreInset = YES; + _ignoreOffset = YES; + + if (offset < 0) { + // Set the inset depending on the situation + if (offset >= -kOpenedViewHeight) { + if (!self.scrollView.dragging) { + if (!_didSetInset) { + _didSetInset = YES; + _hasSectionHeaders = NO; + if([self.scrollView isKindOfClass:[UITableView class]]){ + for (int i = 0; i < [(UITableView *)self.scrollView numberOfSections]; ++i) { + if ([(UITableView *)self.scrollView rectForHeaderInSection:i].size.height) { + _hasSectionHeaders = YES; + break; + } + } + } + } + if (_hasSectionHeaders) { + [self.scrollView setContentInset:UIEdgeInsetsMake(MIN(-offset, kOpenedViewHeight) + self.originalContentInset.top, self.originalContentInset.left, self.originalContentInset.bottom, self.originalContentInset.right)]; + } else { + [self.scrollView setContentInset:UIEdgeInsetsMake(kOpenedViewHeight + self.originalContentInset.top, self.originalContentInset.left, self.originalContentInset.bottom, self.originalContentInset.right)]; + } + } else if (_didSetInset && _hasSectionHeaders) { + [self.scrollView setContentInset:UIEdgeInsetsMake(-offset + self.originalContentInset.top, self.originalContentInset.left, self.originalContentInset.bottom, self.originalContentInset.right)]; + } + } + } else if (_hasSectionHeaders) { + [self.scrollView setContentInset:self.originalContentInset]; + } + _ignoreInset = NO; + _ignoreOffset = NO; + } + return; + } else { + // Check if we can trigger a new refresh and if we can draw the control + BOOL dontDraw = NO; + if (!_canRefresh) { + if (offset >= 0) { + // We can refresh again after the control is scrolled out of view + _canRefresh = YES; + _didSetInset = NO; + } else { + dontDraw = YES; + } + } else { + if (offset >= 0) { + // Don't draw if the control is not visible + dontDraw = YES; + } + } + if (offset > 0 && _lastOffset > offset && !self.scrollView.isTracking) { + // If we are scrolling too fast, don't draw, and don't trigger unless the scrollView bounced back + _canRefresh = NO; + dontDraw = YES; + } + if (dontDraw) { + _shapeLayer.path = nil; + _shapeLayer.shadowPath = nil; + _arrowLayer.path = nil; + _highlightLayer.path = nil; + _lastOffset = offset; + return; + } + } + + _lastOffset = offset; + + BOOL triggered = NO; + + CGMutablePathRef path = CGPathCreateMutable(); + + //Calculate some useful points and values + CGFloat verticalShift = MAX(0, -((kMaxTopRadius + kMaxBottomRadius + kMaxTopPadding + kMaxBottomPadding) + offset)); + CGFloat distance = MIN(kMaxDistance, fabs(verticalShift)); + CGFloat percentage = 1 - (distance / kMaxDistance); + + CGFloat currentTopPadding = lerp(kMinTopPadding, kMaxTopPadding, percentage); + CGFloat currentTopRadius = lerp(kMinTopRadius, kMaxTopRadius, percentage); + CGFloat currentBottomRadius = lerp(kMinBottomRadius, kMaxBottomRadius, percentage); + CGFloat currentBottomPadding = lerp(kMinBottomPadding, kMaxBottomPadding, percentage); + + CGPoint bottomOrigin = CGPointMake(floor(self.bounds.size.width / 2), self.bounds.size.height - currentBottomPadding -currentBottomRadius); + CGPoint topOrigin = CGPointZero; + if (distance == 0) { + topOrigin = CGPointMake(floor(self.bounds.size.width / 2), bottomOrigin.y); + } else { + topOrigin = CGPointMake(floor(self.bounds.size.width / 2), self.bounds.size.height + offset + currentTopPadding + currentTopRadius); + if (percentage == 0) { + bottomOrigin.y -= (fabs(verticalShift) - kMaxDistance); + triggered = YES; + } + } + + //Top semicircle + CGPathAddArc(path, NULL, topOrigin.x, topOrigin.y, currentTopRadius, 0, M_PI, YES); + + //Left curve + CGPoint leftCp1 = CGPointMake(lerp((topOrigin.x - currentTopRadius), (bottomOrigin.x - currentBottomRadius), 0.1), lerp(topOrigin.y, bottomOrigin.y, 0.2)); + CGPoint leftCp2 = CGPointMake(lerp((topOrigin.x - currentTopRadius), (bottomOrigin.x - currentBottomRadius), 0.9), lerp(topOrigin.y, bottomOrigin.y, 0.2)); + CGPoint leftDestination = CGPointMake(bottomOrigin.x - currentBottomRadius, bottomOrigin.y); + + CGPathAddCurveToPoint(path, NULL, leftCp1.x, leftCp1.y, leftCp2.x, leftCp2.y, leftDestination.x, leftDestination.y); + + //Bottom semicircle + CGPathAddArc(path, NULL, bottomOrigin.x, bottomOrigin.y, currentBottomRadius, M_PI, 0, YES); + + //Right curve + CGPoint rightCp2 = CGPointMake(lerp((topOrigin.x + currentTopRadius), (bottomOrigin.x + currentBottomRadius), 0.1), lerp(topOrigin.y, bottomOrigin.y, 0.2)); + CGPoint rightCp1 = CGPointMake(lerp((topOrigin.x + currentTopRadius), (bottomOrigin.x + currentBottomRadius), 0.9), lerp(topOrigin.y, bottomOrigin.y, 0.2)); + CGPoint rightDestination = CGPointMake(topOrigin.x + currentTopRadius, topOrigin.y); + + CGPathAddCurveToPoint(path, NULL, rightCp1.x, rightCp1.y, rightCp2.x, rightCp2.y, rightDestination.x, rightDestination.y); + CGPathCloseSubpath(path); + + if (!triggered) { + // Set paths + + _shapeLayer.path = path; + _shapeLayer.shadowPath = path; + + // Add the arrow shape + + CGFloat currentArrowSize = lerp(kMinArrowSize, kMaxArrowSize, percentage); + CGFloat currentArrowRadius = lerp(kMinArrowRadius, kMaxArrowRadius, percentage); + CGFloat arrowBigRadius = currentArrowRadius + (currentArrowSize / 2); + CGFloat arrowSmallRadius = currentArrowRadius - (currentArrowSize / 2); + CGMutablePathRef arrowPath = CGPathCreateMutable(); + CGPathAddArc(arrowPath, NULL, topOrigin.x, topOrigin.y, arrowBigRadius, 0, 3 * M_PI_2, NO); + CGPathAddLineToPoint(arrowPath, NULL, topOrigin.x, topOrigin.y - arrowBigRadius - currentArrowSize); + CGPathAddLineToPoint(arrowPath, NULL, topOrigin.x + (2 * currentArrowSize), topOrigin.y - arrowBigRadius + (currentArrowSize / 2)); + CGPathAddLineToPoint(arrowPath, NULL, topOrigin.x, topOrigin.y - arrowBigRadius + (2 * currentArrowSize)); + CGPathAddLineToPoint(arrowPath, NULL, topOrigin.x, topOrigin.y - arrowBigRadius + currentArrowSize); + CGPathAddArc(arrowPath, NULL, topOrigin.x, topOrigin.y, arrowSmallRadius, 3 * M_PI_2, 0, YES); + CGPathCloseSubpath(arrowPath); + _arrowLayer.path = arrowPath; + [_arrowLayer setFillRule:kCAFillRuleEvenOdd]; + CGPathRelease(arrowPath); + + // Add the highlight shape + + CGMutablePathRef highlightPath = CGPathCreateMutable(); + CGPathAddArc(highlightPath, NULL, topOrigin.x, topOrigin.y, currentTopRadius, 0, M_PI, YES); + CGPathAddArc(highlightPath, NULL, topOrigin.x, topOrigin.y + 1.25, currentTopRadius, M_PI, 0, NO); + + _highlightLayer.path = highlightPath; + [_highlightLayer setFillRule:kCAFillRuleNonZero]; + CGPathRelease(highlightPath); + + } else { + // Start the shape disappearance animation + + CGFloat radius = lerp(kMinBottomRadius, kMaxBottomRadius, 0.2); + CABasicAnimation *pathMorph = [CABasicAnimation animationWithKeyPath:@"path"]; + pathMorph.duration = 0.15; + pathMorph.fillMode = kCAFillModeForwards; + pathMorph.removedOnCompletion = NO; + CGMutablePathRef toPath = CGPathCreateMutable(); + CGPathAddArc(toPath, NULL, topOrigin.x, topOrigin.y, radius, 0, M_PI, YES); + CGPathAddCurveToPoint(toPath, NULL, topOrigin.x - radius, topOrigin.y, topOrigin.x - radius, topOrigin.y, topOrigin.x - radius, topOrigin.y); + CGPathAddArc(toPath, NULL, topOrigin.x, topOrigin.y, radius, M_PI, 0, YES); + CGPathAddCurveToPoint(toPath, NULL, topOrigin.x + radius, topOrigin.y, topOrigin.x + radius, topOrigin.y, topOrigin.x + radius, topOrigin.y); + CGPathCloseSubpath(toPath); + pathMorph.toValue = ( id)toPath; + [_shapeLayer addAnimation:pathMorph forKey:nil]; + CABasicAnimation *shadowPathMorph = [CABasicAnimation animationWithKeyPath:@"shadowPath"]; + shadowPathMorph.duration = 0.15; + shadowPathMorph.fillMode = kCAFillModeForwards; + shadowPathMorph.removedOnCompletion = NO; + shadowPathMorph.toValue = ( id)toPath; + [_shapeLayer addAnimation:shadowPathMorph forKey:nil]; + CGPathRelease(toPath); + CABasicAnimation *shapeAlphaAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; + shapeAlphaAnimation.duration = 0.1; + shapeAlphaAnimation.beginTime = CACurrentMediaTime() + 0.1; + shapeAlphaAnimation.toValue = [NSNumber numberWithFloat:0]; + shapeAlphaAnimation.fillMode = kCAFillModeForwards; + shapeAlphaAnimation.removedOnCompletion = NO; + [_shapeLayer addAnimation:shapeAlphaAnimation forKey:nil]; + CABasicAnimation *alphaAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; + alphaAnimation.duration = 0.1; + alphaAnimation.toValue = [NSNumber numberWithFloat:0]; + alphaAnimation.fillMode = kCAFillModeForwards; + alphaAnimation.removedOnCompletion = NO; + [_arrowLayer addAnimation:alphaAnimation forKey:nil]; + [_highlightLayer addAnimation:alphaAnimation forKey:nil]; + + [CATransaction begin]; + [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; + _activity.layer.transform = CATransform3DMakeScale(0.1, 0.1, 1); + [CATransaction commit]; + [UIView animateWithDuration:0.2 delay:0.15 options:UIViewAnimationOptionCurveLinear animations:^{ + _activity.alpha = 1; + _activity.layer.transform = CATransform3DMakeScale(1, 1, 1); + } completion:nil]; + + self.refreshing = YES; + _canRefresh = NO; + [self sendActionsForControlEvents:UIControlEventValueChanged]; + } + + CGPathRelease(path); +} + +- (void)beginRefreshing +{ + if (!_refreshing) { + CABasicAnimation *alphaAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; + alphaAnimation.duration = 0.0001; + alphaAnimation.toValue = [NSNumber numberWithFloat:0]; + alphaAnimation.fillMode = kCAFillModeForwards; + alphaAnimation.removedOnCompletion = NO; + [_shapeLayer addAnimation:alphaAnimation forKey:nil]; + [_arrowLayer addAnimation:alphaAnimation forKey:nil]; + [_highlightLayer addAnimation:alphaAnimation forKey:nil]; + + _activity.alpha = 1; + _activity.layer.transform = CATransform3DMakeScale(1, 1, 1); + + CGPoint offset = self.scrollView.contentOffset; + _ignoreInset = YES; + [self.scrollView setContentInset:UIEdgeInsetsMake(kOpenedViewHeight + self.originalContentInset.top, self.originalContentInset.left, self.originalContentInset.bottom, self.originalContentInset.right)]; + _ignoreInset = NO; + [self.scrollView setContentOffset:offset animated:NO]; + + self.refreshing = YES; + _canRefresh = NO; + } +} + +- (void)endRefreshing +{ + if (_refreshing) { + self.refreshing = NO; + // Create a temporary retain-cycle, so the scrollView won't be released + // halfway through the end animation. + // This allows for the refresh control to clean up the observer, + // in the case the scrollView is released while the animation is running + __block UIScrollView *blockScrollView = self.scrollView; + [UIView animateWithDuration:0.4 animations:^{ + _ignoreInset = YES; + [blockScrollView setContentInset:self.originalContentInset]; + _ignoreInset = NO; + _activity.alpha = 0; + _activity.layer.transform = CATransform3DMakeScale(0.1, 0.1, 1); + } completion:^(BOOL finished) { + [_shapeLayer removeAllAnimations]; + _shapeLayer.path = nil; + _shapeLayer.shadowPath = nil; + _shapeLayer.position = CGPointZero; + [_arrowLayer removeAllAnimations]; + _arrowLayer.path = nil; + [_highlightLayer removeAllAnimations]; + _highlightLayer.path = nil; + // We need to use the scrollView somehow in the end block, + // or it'll get released in the animation block. + _ignoreInset = YES; + [blockScrollView setContentInset:self.originalContentInset]; + _ignoreInset = NO; + }]; + } +} + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOToastView.h b/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOToastView.h new file mode 100644 index 0000000..be85168 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOToastView.h @@ -0,0 +1,15 @@ +// +// MFOToastView.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/16/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@interface MFOToastView : UIView + +- (id)initWithParentView:(UIView*)parentView withMessage:(NSString*)message; + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOToastView.m b/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOToastView.m new file mode 100644 index 0000000..c615fd4 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/custom_gui_components/MFOToastView.m @@ -0,0 +1,72 @@ +// +// MFOToastView.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/16/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOToastView.h" +#import + +#define VIEW_WIDTH 220 +#define VIEW_DEFULT_HEIGHT 160 +#define ANIMATION_DURATION 1.2 + +@implementation MFOToastView + +- (id)initWithParentView:(UIView*)parentView withMessage:(NSString*)message +{ + self = [super init]; + + self.backgroundColor = [UIColor clearColor]; + + UITextView *txtviewMessage =[[UITextView alloc]initWithFrame:CGRectMake(0, 0, VIEW_WIDTH, VIEW_DEFULT_HEIGHT)]; + txtviewMessage.backgroundColor = [UIColor clearColor]; + txtviewMessage.text = message; + txtviewMessage.userInteractionEnabled = NO; + txtviewMessage.font = [UIFont fontWithName:@"Futura" size:16.0f]; + txtviewMessage.textColor = [UIColor whiteColor]; + txtviewMessage.textAlignment = NSTextAlignmentCenter; + [self addSubview:txtviewMessage]; + + CGRect frame = txtviewMessage.frame; + frame.size.height = [txtviewMessage contentSize].height; + float height = [txtviewMessage contentSize].height; + txtviewMessage.frame = CGRectMake(0, 0, VIEW_WIDTH, height); + self.frame = CGRectMake((parentView.frame.size.width - VIEW_WIDTH) / 2, (parentView.frame.size.height - height) / 2, VIEW_WIDTH, height); + + UIView *backView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, VIEW_WIDTH, height)]; + backView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.7f]; + [backView.layer setCornerRadius:4.0f]; + [backView.layer setMasksToBounds:YES]; + [backView.layer setBorderColor:[[UIColor grayColor] CGColor]]; + backView.layer.borderWidth = 1.0; + [self addSubview:backView]; + [backView release]; + [self bringSubviewToFront:txtviewMessage]; + [txtviewMessage release]; + [NSTimer scheduledTimerWithTimeInterval:1.2 + target:self + selector:@selector(hideMe:) + userInfo:nil + repeats:NO]; + + return self; +} + +-(void)hideMe:(NSTimer*)timer +{ + [timer invalidate]; + [UIView animateWithDuration:ANIMATION_DURATION + delay:0.0 + options: UIViewAnimationCurveEaseOut + animations:^{ + [self setAlpha:0.0]; + } + completion:^(BOOL finished){ + [self removeFromSuperview]; + }]; +} + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/data/MyFilesOnline.xcdatamodeld/.xccurrentversion b/non-ARC/MyFilesOnline/MyFilesOnline/data/MyFilesOnline.xcdatamodeld/.xccurrentversion new file mode 100644 index 0000000..ad0ce2c --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/data/MyFilesOnline.xcdatamodeld/.xccurrentversion @@ -0,0 +1,8 @@ + + + + + _XCCurrentVersionName + MyFilesOnline.xcdatamodel + + diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/data/MyFilesOnline.xcdatamodeld/MyFilesOnline.xcdatamodel/contents b/non-ARC/MyFilesOnline/MyFilesOnline/data/MyFilesOnline.xcdatamodeld/MyFilesOnline.xcdatamodel/contents new file mode 100644 index 0000000..f59545f --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/data/MyFilesOnline.xcdatamodeld/MyFilesOnline.xcdatamodel/contents @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/en.lproj/InfoPlist.strings b/non-ARC/MyFilesOnline/MyFilesOnline/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/en.lproj/MainStoryboard_iPad.storyboard b/non-ARC/MyFilesOnline/MyFilesOnline/en.lproj/MainStoryboard_iPad.storyboard new file mode 100644 index 0000000..42f4b8f --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/en.lproj/MainStoryboard_iPad.storyboard @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/en.lproj/MainStoryboard_iPhone.storyboard b/non-ARC/MyFilesOnline/MyFilesOnline/en.lproj/MainStoryboard_iPhone.storyboard new file mode 100644 index 0000000..8adf8db --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/en.lproj/MainStoryboard_iPhone.storyboard @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/main.m b/non-ARC/MyFilesOnline/MyFilesOnline/main.m new file mode 100644 index 0000000..b270370 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/main.m @@ -0,0 +1,18 @@ +// +// main.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +#import "MFOAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([MFOAppDelegate class])); + } +} diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/model/MyDirectoryInfo.h b/non-ARC/MyFilesOnline/MyFilesOnline/model/MyDirectoryInfo.h new file mode 100644 index 0000000..ae26077 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/model/MyDirectoryInfo.h @@ -0,0 +1,35 @@ +// +// MyDirectoryInfo.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import +#import + +@class MyFileTypes; + +@interface MyDirectoryInfo : NSManagedObject + +@property (nonatomic, retain) NSNumber * availableSpace; +@property (nonatomic, retain) NSNumber * last_rev_id; +@property (nonatomic, retain) NSString * mode; +@property (nonatomic, retain) NSNumber * my_files_count; +@property (nonatomic, retain) NSNumber * pendingRequests; +@property (nonatomic, retain) NSNumber * rev_id; +@property (nonatomic, retain) NSNumber * shared_files_count; +@property (nonatomic, retain) NSNumber * totalSpace; +@property (nonatomic, retain) NSNumber * usedSpace; +@property (nonatomic, retain) NSSet *fileTypes; +@end + +@interface MyDirectoryInfo (CoreDataGeneratedAccessors) + +- (void)addFileTypesObject:(MyFileTypes *)value; +- (void)removeFileTypesObject:(MyFileTypes *)value; +- (void)addFileTypes:(NSSet *)values; +- (void)removeFileTypes:(NSSet *)values; + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/model/MyDirectoryInfo.m b/non-ARC/MyFilesOnline/MyFilesOnline/model/MyDirectoryInfo.m new file mode 100644 index 0000000..2b0e2a2 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/model/MyDirectoryInfo.m @@ -0,0 +1,26 @@ +// +// MyDirectoryInfo.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MyDirectoryInfo.h" +#import "MyFileTypes.h" + + +@implementation MyDirectoryInfo + +@dynamic availableSpace; +@dynamic last_rev_id; +@dynamic mode; +@dynamic my_files_count; +@dynamic pendingRequests; +@dynamic rev_id; +@dynamic shared_files_count; +@dynamic totalSpace; +@dynamic usedSpace; +@dynamic fileTypes; + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/model/MyFileInfo.h b/non-ARC/MyFilesOnline/MyFilesOnline/model/MyFileInfo.h new file mode 100644 index 0000000..5dff99c --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/model/MyFileInfo.h @@ -0,0 +1,37 @@ +// +// MyFileInfo.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/24/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import +#import + +@class MyFileTypes; + +@interface MyFileInfo : NSManagedObject + +@property (nonatomic, retain) NSDate * created_date; +@property (nonatomic, retain) NSNumber * is_shared; +@property (nonatomic, retain) NSNumber * item_id; +@property (nonatomic, retain) NSString * last_updated_by; +@property (nonatomic, retain) NSDate * last_updated_date; +@property (nonatomic, retain) NSString * link; +@property (nonatomic, retain) NSString * mime_type; +@property (nonatomic, retain) NSString * name; +@property (nonatomic, retain) NSNumber * parent_id; +@property (nonatomic, retain) NSString * path; +@property (nonatomic, retain) NSString * path_by_id; +@property (nonatomic, retain) NSString * share_id; +@property (nonatomic, retain) NSNumber * share_level; +@property (nonatomic, retain) NSNumber * shared_by; +@property (nonatomic, retain) NSDate * shared_date; +@property (nonatomic, retain) NSNumber * size; +@property (nonatomic, retain) NSString * status; +@property (nonatomic, retain) NSString * type; +@property (nonatomic, retain) NSNumber * user_id; +@property (nonatomic, retain) MyFileTypes *parentFileTypes; + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/model/MyFileInfo.m b/non-ARC/MyFilesOnline/MyFilesOnline/model/MyFileInfo.m new file mode 100644 index 0000000..56c1b5f --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/model/MyFileInfo.m @@ -0,0 +1,36 @@ +// +// MyFileInfo.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/24/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MyFileInfo.h" +#import "MyFileTypes.h" + + +@implementation MyFileInfo + +@dynamic created_date; +@dynamic is_shared; +@dynamic item_id; +@dynamic last_updated_by; +@dynamic last_updated_date; +@dynamic link; +@dynamic mime_type; +@dynamic name; +@dynamic parent_id; +@dynamic path; +@dynamic path_by_id; +@dynamic share_id; +@dynamic share_level; +@dynamic shared_by; +@dynamic shared_date; +@dynamic size; +@dynamic status; +@dynamic type; +@dynamic user_id; +@dynamic parentFileTypes; + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/model/MyFileTypes.h b/non-ARC/MyFilesOnline/MyFilesOnline/model/MyFileTypes.h new file mode 100644 index 0000000..41a23cf --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/model/MyFileTypes.h @@ -0,0 +1,29 @@ +// +// MyFileTypes.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import +#import + +@class MyDirectoryInfo, MyFileInfo; + +@interface MyFileTypes : NSManagedObject + +@property (nonatomic, retain) NSString * id; +@property (nonatomic, retain) NSString * name; +@property (nonatomic, retain) MyDirectoryInfo *directoryInfo; +@property (nonatomic, retain) NSSet *fileInfo; +@end + +@interface MyFileTypes (CoreDataGeneratedAccessors) + +- (void)addFileInfoObject:(MyFileInfo *)value; +- (void)removeFileInfoObject:(MyFileInfo *)value; +- (void)addFileInfo:(NSSet *)values; +- (void)removeFileInfo:(NSSet *)values; + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/model/MyFileTypes.m b/non-ARC/MyFilesOnline/MyFilesOnline/model/MyFileTypes.m new file mode 100644 index 0000000..f646b36 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/model/MyFileTypes.m @@ -0,0 +1,21 @@ +// +// MyFileTypes.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MyFileTypes.h" +#import "MyDirectoryInfo.h" +#import "MyFileInfo.h" + + +@implementation MyFileTypes + +@dynamic id; +@dynamic name; +@dynamic directoryInfo; +@dynamic fileInfo; + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFODetailViewController.h b/non-ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFODetailViewController.h new file mode 100644 index 0000000..596bbb6 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFODetailViewController.h @@ -0,0 +1,20 @@ +// +// MFODetailViewController.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@interface MFODetailViewController : UITableViewController +{ + int visibleRowCount; +} + +@property (nonatomic, strong) NSManagedObjectContext* managedObjectContext; +@property (nonatomic, retain) NSFetchedResultsController *fetchedResultsController; +@property (nonatomic, retain) NSString *parentFileTypeId; + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFODetailViewController.m b/non-ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFODetailViewController.m new file mode 100644 index 0000000..e2f1e62 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFODetailViewController.m @@ -0,0 +1,217 @@ +// +// MFODetailViewController.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFODetailViewController.h" +#import "MFOConstants.h" +#import "MyFileInfo.h" +#import "MFOFileDetailsCell.h" +#import "MFOUtility.h" + +#define FOOTER_VIEW_HEIGHT 36 + +@interface MFODetailViewController () + +@property (strong, nonatomic) UIPopoverController *masterPopoverController; +- (void)configureView; + +@end + + +@implementation MFODetailViewController + +@synthesize parentFileTypeId; +@synthesize managedObjectContext; +@synthesize fetchedResultsController = _fetchedResultsController; + +- (void)dealloc +{ + [parentFileTypeId release]; + [_masterPopoverController release]; + [super dealloc]; +} + +#pragma mark - Managing the NSPredicate item + +- (void)setParentFileTypeId:(NSString*)newParentFileTypeId +{ + if (![self.parentFileTypeId isEqualToString:newParentFileTypeId]) + { + [parentFileTypeId release]; + parentFileTypeId = [newParentFileTypeId retain]; + + self.fetchedResultsController = nil; + visibleRowCount = FETCH_BATCH_SIZE; + [self configureView]; + } + + if (self.masterPopoverController != nil) { + [self.masterPopoverController dismissPopoverAnimated:YES]; + } +} + +- (void)configureView +{ + NSError *error; + + if (![[self fetchedResultsController] performFetch:&error]) + { + NSLog(@"Unresolved error %@, %@", error, [error userInfo]); + exit(-1); // Fail + } + + [self.tableView reloadData]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; +} + +- (NSFetchedResultsController *)fetchedResultsController +{ + if (_fetchedResultsController != nil) { + return _fetchedResultsController; + } + + NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; + + NSEntityDescription *entity = [NSEntityDescription entityForName:@"MyFileInfo" inManagedObjectContext:managedObjectContext]; + [fetchRequest setEntity:entity]; + + fetchRequest.predicate = [NSPredicate predicateWithFormat:@"parentFileTypes.id==%@", self.parentFileTypeId]; + + NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES]; + [fetchRequest setSortDescriptors:[NSArray arrayWithObject:sort]]; + + [fetchRequest setFetchBatchSize:FETCH_BATCH_SIZE]; + + NSFetchedResultsController *theFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:managedObjectContext sectionNameKeyPath:nil cacheName:nil]; + + self.fetchedResultsController = theFetchedResultsController; + _fetchedResultsController.delegate = self; + + [theFetchedResultsController release]; + [sort release]; + + return _fetchedResultsController; +} + +- (void)configureCell:(MFOFileDetailsCell *)cell atIndexPath:(NSIndexPath *)indexPath +{ + MyFileInfo *fileInfo = [_fetchedResultsController objectAtIndexPath:indexPath]; + + cell.nameLabel.text = fileInfo.name; + cell.lastUpdatedByLabel.text = [NSString stringWithFormat:@"Last updated by: %@", fileInfo.last_updated_by]; + cell.statusLabel.text = [NSString stringWithFormat:@"Status: %@", fileInfo.status]; + cell.sharedByLabel.text = [NSString stringWithFormat:@"Shared by: %@", [fileInfo.shared_by stringValue]]; + cell.pathLabel.text = [NSString stringWithFormat:@"Path: %@", fileInfo.path]; + cell.linkLabel.text = [NSString stringWithFormat:@"Link: %@", fileInfo.link]; + cell.updateDateLabel.text = [NSString stringWithFormat:@"Updated: %@", [MFOUtility getStringFromDate:fileInfo.last_updated_date]]; + cell.createDateLabel.text = [NSString stringWithFormat:@"Created: %@", [MFOUtility getStringFromDate:fileInfo.created_date]]; + cell.shareDateLabel.text = [NSString stringWithFormat:@"Shared: %@", [MFOUtility getStringFromDate:fileInfo.shared_date]]; +} + +- (void)viewDidUnload +{ + self.fetchedResultsController = nil; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + id sectionInfo = [[_fetchedResultsController sections] objectAtIndex:section]; + int totalNumberOfObjects = [sectionInfo numberOfObjects]; + + if (totalNumberOfObjects > visibleRowCount) + return visibleRowCount; + else + return totalNumberOfObjects; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *CellIdentifier = @"DetailCell"; + MFOFileDetailsCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; + + [self configureCell:cell atIndexPath:indexPath]; + + return cell; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section +{ + int totalNumberOfObjects = [[[_fetchedResultsController sections] objectAtIndex:0] numberOfObjects]; + + if (totalNumberOfObjects <= visibleRowCount) + return 0.0; + + return FOOTER_VIEW_HEIGHT; +} + +- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section +{ + UIView *footerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, FOOTER_VIEW_HEIGHT)] autorelease]; + footerView.backgroundColor = [UIColor colorWithWhite:.1 alpha:.7]; + + UIButton *loadMoreButton = [UIButton buttonWithType:UIButtonTypeCustom]; + loadMoreButton.frame = footerView.frame; + loadMoreButton.showsTouchWhenHighlighted = YES; + [loadMoreButton setTitle:@"Load more..." forState:UIControlStateNormal]; + [loadMoreButton addTarget:self action:@selector(actionLoadMoreButton:) forControlEvents:UIControlEventTouchUpInside]; + [footerView addSubview:loadMoreButton]; + + loadMoreButton.autoresizingMask = UIViewAutoresizingFlexibleWidth; + + return footerView; +} + +- (void)actionLoadMoreButton:(id)sender +{ + visibleRowCount += FETCH_BATCH_SIZE; + [self.tableView reloadData]; + + id sectionInfo = [[_fetchedResultsController sections] objectAtIndex:0]; + int totalNumberOfObjects = [sectionInfo numberOfObjects]; + + int smallerNumber = visibleRowCount; + + if (visibleRowCount > totalNumberOfObjects) + smallerNumber = totalNumberOfObjects; + + NSIndexPath* ipath = [NSIndexPath indexPathForRow:smallerNumber-1 inSection:0]; + [self.tableView scrollToRowAtIndexPath:ipath atScrollPosition: UITableViewScrollPositionTop animated:YES]; +} + +#pragma mark - Split view + +- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController +{ + barButtonItem.title = NSLocalizedString(@"My directory", @"My directory"); + [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES]; + self.masterPopoverController = popoverController; +} + +- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem +{ + [self.navigationItem setLeftBarButtonItem:nil animated:YES]; + self.masterPopoverController = nil; +} + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFOMasterViewController.h b/non-ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFOMasterViewController.h new file mode 100644 index 0000000..ff6a0ac --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFOMasterViewController.h @@ -0,0 +1,28 @@ +// +// MFOMasterViewController.h +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import +#import "MFOHTTPClient.h" + +@class MFODetailViewController; +@class MFOCoreDataManager; +@class MFORefreshControl; + +#import + +@interface MFOMasterViewController : UITableViewController +{ + MFOCoreDataManager *coreDataManager; + MFORefreshControl *refreshControl; +} + +@property (strong, nonatomic) MFODetailViewController *detailViewController; +@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController; +@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext; + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFOMasterViewController.m b/non-ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFOMasterViewController.m new file mode 100644 index 0000000..66c6fb5 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnline/view_controllers/MFOMasterViewController.m @@ -0,0 +1,292 @@ +// +// MFOMasterViewController.m +// MyFilesOnline +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MFOMasterViewController.h" +#import "MFODetailViewController.h" +#import "MFORefreshControl.h" +#import "MFOConstants.h" +#import "MFOAppDelegate.h" +#import "MFOUtility.h" +#import "MFOToastView.h" +#import "MyDirectoryInfo.h" +#import "MyFileTypes.h" +#import "MFOCoreDataManager.h" + +@interface MFOMasterViewController () + +@property (nonatomic, retain) MyDirectoryInfo *directoryInfo; + +- (void)refreshControlDidBeginRefreshing:(MFORefreshControl *)refreshControl; +- (NSString*)getFileTypeIdForIndexpath:(NSIndexPath*)indexPath; +- (BOOL)isSharedFilesSelectedOnRow:(int)row; +- (NSString*)getTitleTextForRow:(int)row; +- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath; + +@end + + +@implementation MFOMasterViewController + +@synthesize directoryInfo; + +- (void)awakeFromNib +{ + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) + { + self.clearsSelectionOnViewWillAppear = NO; + self.contentSizeForViewInPopover = CGSizeMake(320.0, 600.0); + } + + [super awakeFromNib]; +} + +- (void)dealloc +{ + [refreshControl release]; + [coreDataManager release]; + [_detailViewController release]; + [_fetchedResultsController release]; + [_managedObjectContext release]; + [super dealloc]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.detailViewController = (MFODetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController]; + + refreshControl = [[MFORefreshControl alloc] initInScrollView:self.tableView]; + [refreshControl addTarget:self action:@selector(refreshControlDidBeginRefreshing:) forControlEvents:UIControlEventValueChanged]; + + coreDataManager = [[MFOCoreDataManager alloc] init]; + coreDataManager.fetchedResultsController = self.fetchedResultsController; + + self.directoryInfo = [coreDataManager getDirectoryInfoFromDatabase]; +} + +- (void)refreshControlDidBeginRefreshing:(MFORefreshControl *)refreshControl +{ + MFOHTTPClient *httpClient = [[MFOHTTPClient alloc] initWithURL:[NSURL URLWithString:MFO_URL] andDelegate:self]; + [httpClient release]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; +} + +#pragma mark - Table View + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 9; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; + [self configureCell:cell atIndexPath:indexPath]; + + return cell; +} + +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath +{ + return NO; +} + +- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath +{ + return NO; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) + { + NSString *myFileTypeId = [self getFileTypeIdForIndexpath:indexPath]; + + self.detailViewController.managedObjectContext = self.managedObjectContext; + self.detailViewController.parentFileTypeId = myFileTypeId; + self.detailViewController.title = [self getTitleTextForRow:indexPath.row]; + } +} + +- (BOOL)isSharedFilesSelectedOnRow:(int)row +{ + return (row == 8) ? TRUE : FALSE; +} + +- (NSString*)getTitleTextForRow:(int)row +{ + return ([self isSharedFilesSelectedOnRow:row]) ? @"My Shared Files" : @"My Files"; +} + +- (NSString*)getFileTypeIdForIndexpath:(NSIndexPath*)indexPath +{ + NSSortDescriptor *sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"id" ascending:YES] autorelease]; + NSArray *sortDescriptors = @[sortDescriptor]; + + return [[[directoryInfo.fileTypes sortedArrayUsingDescriptors:sortDescriptors] objectAtIndex:[self isSharedFilesSelectedOnRow:indexPath.row]] id]; +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender +{ + if ([[segue identifier] isEqualToString:@"showDetail"]) + { + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + + NSString *myFileTypeId = [self getFileTypeIdForIndexpath:indexPath]; + + [segue.destinationViewController setManagedObjectContext:self.managedObjectContext]; + [[segue destinationViewController] setParentFileTypeId:myFileTypeId]; + [segue.destinationViewController setTitle:[self getTitleTextForRow:indexPath.row]]; + } +} + +#pragma mark - Fetched results controller + +- (NSFetchedResultsController *)fetchedResultsController +{ + if (_fetchedResultsController != nil) { + return _fetchedResultsController; + } + + NSFetchRequest *fetchRequest = [[[NSFetchRequest alloc] init] autorelease]; + NSEntityDescription *entity = [NSEntityDescription entityForName:@"MyDirectoryInfo" inManagedObjectContext:self.managedObjectContext]; + [fetchRequest setEntity:entity]; + + [fetchRequest setFetchBatchSize:FETCH_BATCH_SIZE]; + + NSSortDescriptor *sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"rev_id" ascending:NO] autorelease]; + NSArray *sortDescriptors = @[sortDescriptor]; + + [fetchRequest setSortDescriptors:sortDescriptors]; + + NSFetchedResultsController *aFetchedResultsController = [[[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:self.managedObjectContext sectionNameKeyPath:nil cacheName:@"Master"] autorelease]; + + aFetchedResultsController.delegate = self; + self.fetchedResultsController = aFetchedResultsController; + + NSError *error = nil; + if (![self.fetchedResultsController performFetch:&error]) + { + NSLog(@"Unresolved error %@, %@", error, [error userInfo]); + abort(); + } + + return _fetchedResultsController; +} + +- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath +{ + cell.accessoryType = UITableViewCellAccessoryNone; + cell.userInteractionEnabled = NO; + + switch (indexPath.row) + { + case 0: + cell.detailTextLabel.text = [MFOUtility convertbyteToKB_MB:[self.directoryInfo.totalSpace longLongValue]]; + cell.textLabel.text = @"Total space"; + break; + case 1: + cell.detailTextLabel.text = [self.directoryInfo.last_rev_id stringValue]; + cell.textLabel.text = @"Last rev id"; + break; + case 2: + cell.detailTextLabel.text = [MFOUtility convertbyteToKB_MB:[self.directoryInfo.usedSpace longLongValue]]; + cell.textLabel.text = @"Used space"; + break; + case 3: + cell.detailTextLabel.text = [MFOUtility convertbyteToKB_MB:[self.directoryInfo.availableSpace longLongValue]]; + cell.textLabel.text = @"Available space"; + break; + case 4: + cell.detailTextLabel.text = self.directoryInfo.mode; + cell.textLabel.text = @"Mode"; + break; + case 5: + cell.detailTextLabel.text = [self.directoryInfo.pendingRequests stringValue]; + cell.textLabel.text = @"Pending requests"; + break; + case 6: + cell.detailTextLabel.text = [self.directoryInfo.my_files_count stringValue]; + cell.textLabel.text = @"My files count"; + cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + cell.userInteractionEnabled = YES; + break; + case 7: + cell.detailTextLabel.text = [self.directoryInfo.rev_id stringValue]; + cell.textLabel.text = @"Rev id"; + break; + case 8: + cell.detailTextLabel.text = [self.directoryInfo.shared_files_count stringValue]; + cell.textLabel.text = @"Shared files count"; + cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + cell.userInteractionEnabled = YES; + break; + default: + cell.textLabel.text = @"Extra"; + cell.detailTextLabel.text = @"Extra"; + break; + } +} + +#pragma mark - HTTPClient Delegate Methods + +- (void)HTTPClientDidReceiveData:(NSData*)data +{ + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^ + { + NSDictionary *jSONResponce = [MFOUtility getJSONDictionnaryFromData:data]; + [coreDataManager clearDatabase]; + self.fetchedResultsController = nil; + [coreDataManager populateDatabaseWithJSON:jSONResponce]; + self.directoryInfo = [coreDataManager getDirectoryInfoFromDatabase]; + dispatch_async(dispatch_get_main_queue(), ^ + { + [refreshControl endRefreshing]; + [self.tableView reloadData]; + }); + }); +} + +- (void)HTTPClientDidReceiveEmpty +{ + [refreshControl endRefreshing]; + + MFOToastView *toastView = [[MFOToastView alloc] initWithParentView:self.view withMessage:@"Request returns empty"]; + [self.view addSubview:toastView]; + [toastView release]; +} + +- (void)HTTPClientDidTimeOut +{ + [refreshControl endRefreshing]; + + MFOToastView *toastView = [[MFOToastView alloc] initWithParentView:self.view withMessage:@"Request timed out"]; + [self.view addSubview:toastView]; + [toastView release]; +} + +- (void)HTTPClientDownloadError:(NSString*)errorMessage +{ + [refreshControl endRefreshing]; + + MFOToastView *toastView = [[MFOToastView alloc] initWithParentView:self.view withMessage:@"Download Error"]; + [self.view addSubview:toastView]; + [toastView release]; +} + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests-Info.plist b/non-ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests-Info.plist new file mode 100644 index 0000000..d828dde --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.war.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/non-ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests.h b/non-ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests.h new file mode 100644 index 0000000..0c902f4 --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests.h @@ -0,0 +1,13 @@ +// +// MyFilesOnlineTests.h +// MyFilesOnlineTests +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import + +@interface MyFilesOnlineTests : SenTestCase + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests.m b/non-ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests.m new file mode 100644 index 0000000..9dbbe8f --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnlineTests/MyFilesOnlineTests.m @@ -0,0 +1,46 @@ +// +// MyFilesOnlineTests.m +// MyFilesOnlineTests +// +// Created by Warif Akhand Rishi on 2/23/13. +// Copyright (c) 2013 Warif Akhand Rishi. All rights reserved. +// + +#import "MyFilesOnlineTests.h" +#import "MFOConstants.h" + +@implementation MyFilesOnlineTests + +- (void)setUp +{ + [super setUp]; + + // Set-up code here. +} + +- (void)tearDown +{ + // Tear-down code here. + + [super tearDown]; +} + +- (void)testSTAssertTrue +{ + NSString *testString = @"testString"; + STAssertTrue([testString isEqualToString:@"testString"], @""); +} + +- (void)testSTAssertFalse +{ + NSString *testString = @"testString"; + STAssertFalse([testString isEqualToString:@"not testString"], @""); +} + +- (void)testSTAssertEqualObjects +{ + NSString *testString = @"testString"; + STAssertEqualObjects(testString, testString, @""); +} + +@end diff --git a/non-ARC/MyFilesOnline/MyFilesOnlineTests/en.lproj/InfoPlist.strings b/non-ARC/MyFilesOnline/MyFilesOnlineTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/non-ARC/MyFilesOnline/MyFilesOnlineTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ +