Browse files

Update readme and add refresh button to sample

  • Loading branch information...
1 parent 7374155 commit e99cd624c81359e835abcb43b0a701a1c983e1a6 @scottdensmore scottdensmore committed Nov 6, 2011
View
18 README.md
@@ -21,6 +21,24 @@ Go into your project schema and add the environment variable WALogging and set i
The watoolkitios-samples project contains a working iPhone project sample located in the samples directory to demonstrate the functionality of the library. To use this, download the XCode 4 project and compile. Before running, be sure to enter your Windows Azure storage account name and access key in RootViewController.m. Your account name and access key can be obtained from the Windows Azure portal.
## Using the Library in your application
+Xcode 4.x (library)
+-------------------
+1. Open the watoolkit-lib Xcode project.
+1. Compile the project for release.
+1. Place the .a file and the header files somewhere that you can reference from your project (for this example lets say lib).
+1. Click on your project's name in the sidebar on the left to open the project settings view in the right pane of the window.
+1. In the middle pane you will see **PROJECT** and **TARGETS** headers for your project. Click on your project name, then select **Build Settings** along the top to open the Build Settings editor for your entire project.
+1. Find the **Header Search Paths** setting. Double click and add a new entry. Add a search path to the directory you have the header files for the static library and check the `Recursive` checkbox. Also add `/usr/include/libxml2` to the search path and check `Recursive`.
+ * Find the **Library Search Paths** setting. Double click and add a new entry. Add a search path to the **libwatoolkitios.a** file for the library directory you have for your project.
+1. Find the **Other Linker Flags** entry and double click it. Use the **+** button to add a new entry and enter `-ObjC -all_load`. Dismiss the editor with the **Done** button.
+1. Locate the target you wish to add Windows Azure iOS Toolkit to in the **TARGETS** list in the middle of the editor pane. Select it to open the target settings editor in the right pane of the window.
+1. Click the **Build Phases** tab along the top of the window to open the Build Phases editor.
+1. Click the disclosure triangles next to the **Target Dependencies** and **Link Binary with Libraries** items.
+1. In the **Target Dependencies** section, click the **+** button to open the Target selection sheet. Click on the **libwatoolkitios.a** target and click the **Add** button to create a dependency.
+1. In the **Link Binary with Libraries** section, click the **+** button to open the Library selection sheet. Here we need to instruct the target to link against all the required watoolkitios-lib libraries and one system libraries. Select each of the following items (one at a time or while holding down the Command key to select all of them at once) and then click the **Add** button:
+ * **libwatoolkitios.a**
+ * **libxml2.2.dylib**
+1. Verify that all of the libraries are showing up in the **Link Binary with Libraries** section before continuing.
Xcode 4.x (Git Submodule)
-------------------------
View
22 samples/Samples/Client/EntityListController.m
@@ -32,6 +32,8 @@ - (void)fetchEntities;
- (void)editEntity:(NSUInteger)index;
- (void)showAddButton;
- (void)showActivity;
+- (void)showRefreshButton;
+- (IBAction)refreshData:(id)sender;
@end
@@ -77,6 +79,7 @@ - (void)viewDidLoad
Azure_Storage_ClientAppDelegate *appDelegate = (Azure_Storage_ClientAppDelegate *)[[UIApplication sharedApplication] delegate];
[self showAddButton];
+ [self showRefreshButton];
storageClient = [[WACloudStorageClient storageClientWithCredential:appDelegate.authenticationCredential] retain];
storageClient.delegate = self;
@@ -114,6 +117,16 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
#pragma mark - Action methods
+- (IBAction)refreshData:(id)sender
+{
+ [_localEntityList removeAllObjects];
+ if (_resultContinuation) {
+ [_resultContinuation release];
+ _resultContinuation = nil;
+ }
+ [self fetchEntities];
+}
+
- (IBAction)addEntity:(id)sender
{
ModifyEntityController *newController = [[ModifyEntityController alloc] initWithNibName:@"ModifyEntityController" bundle:nil];
@@ -163,6 +176,15 @@ - (void)showAddButton
action:@selector(addEntity:)] autorelease];
}
+- (void)showRefreshButton
+{
+ UIBarButtonItem *refreshButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refreshData:)];
+ self.toolbarItems = [NSArray arrayWithObjects:refreshButton, nil];
+ UINavigationController *controller = self.navigationController;
+ [controller setToolbarHidden:NO animated:YES];
+ [refreshButton release];
+}
+
- (void)showActivity
{
UIActivityIndicatorView *view = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
View
25 samples/Samples/Client/TableListController.m
@@ -40,6 +40,8 @@ - (StorageType)storageType;
- (void)fetchData;
- (void)showAddButton;
- (void)showActivity;
+- (void)showRefreshButton;
+- (IBAction)refreshData:(id)sender;
@end
@@ -88,7 +90,8 @@ - (void)viewDidLoad
storageClient = nil;
[self showAddButton];
-
+ [self showRefreshButton];
+
_localStorageList = [[NSMutableArray alloc] initWithCapacity:MAX_ROWS];
}
@@ -131,6 +134,16 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
#pragma mark - Action Methods
+- (IBAction)refreshData:(id)sender
+{
+ [_localStorageList removeAllObjects];
+ if (_resultContinuation) {
+ [_resultContinuation release];
+ _resultContinuation = nil;
+ }
+ [self fetchData];
+}
+
- (IBAction)modifyStorage:(id)sender
{
CreateTableController *newController = [[CreateTableController alloc] initWithNibName:@"CreateTableController" bundle:nil];
@@ -213,6 +226,16 @@ - (void)showAddButton
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(modifyStorage:)] autorelease];
}
+- (void)showRefreshButton
+{
+ UIBarButtonItem *refreshButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refreshData:)];
+ UINavigationController *controller = self.navigationController;
+ [controller setToolbarHidden:NO animated:YES];
+ self.toolbarItems = [NSArray arrayWithObjects:refreshButton, nil];
+ [refreshButton release];
+
+}
+
- (void)showActivity
{
UIActivityIndicatorView *view = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
View
37 samples/Samples/Client/TableListController.xib
@@ -2,13 +2,13 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1056</int>
- <string key="IBDocument.SystemVersion">10J869</string>
- <string key="IBDocument.InterfaceBuilderVersion">1305</string>
- <string key="IBDocument.AppKitVersion">1038.35</string>
- <string key="IBDocument.HIToolboxVersion">461.00</string>
+ <string key="IBDocument.SystemVersion">11C74</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1617</string>
+ <string key="IBDocument.AppKitVersion">1138.23</string>
+ <string key="IBDocument.HIToolboxVersion">567.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">300</string>
+ <string key="NS.object.0">534</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -39,9 +39,9 @@
<object class="IBUITableView" id="873029372">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
- <string key="NSFrame">{{0, 64}, {320, 416}}</string>
+ <string key="NSFrame">{{0, 64}, {320, 372}}</string>
<reference key="NSSuperview"/>
- <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
@@ -53,6 +53,7 @@
<object class="IBUISimulatedNavigationBarMetrics" key="IBUISimulatedTopBarMetrics">
<bool key="IBUIPrompted">NO</bool>
</object>
+ <object class="IBUISimulatedToolbarMetrics" key="IBUISimulatedBottomBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIBouncesZoom">NO</bool>
<int key="IBUISeparatorStyle">1</int>
@@ -123,15 +124,17 @@
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
+ <string>-1.IBPluginDependency</string>
<string>-2.CustomClassName</string>
- <string>4.IBEditorWindowLastContentRect</string>
+ <string>-2.IBPluginDependency</string>
<string>4.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>TableListController</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UIResponder</string>
- <string>{{329, 504}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
@@ -149,19 +152,7 @@
<nil key="sourceID"/>
<int key="maxID">7</int>
</object>
- <object class="IBClassDescriber" key="IBDocument.Classes">
- <object class="NSMutableArray" key="referencedPartialClassDescriptions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBPartialClassDescription">
- <string key="className">TableListController</string>
- <string key="superclassName">UITableViewController</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/TableListController.h</string>
- </object>
- </object>
- </object>
- </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
@@ -170,6 +161,6 @@
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">300</string>
+ <string key="IBCocoaTouchPluginVersion">534</string>
</data>
</archive>
View
86 samples/Samples/Client/en.lproj/MainWindow.xib
@@ -2,20 +2,21 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1024</int>
- <string key="IBDocument.SystemVersion">10J869</string>
- <string key="IBDocument.InterfaceBuilderVersion">1306</string>
- <string key="IBDocument.AppKitVersion">1038.35</string>
- <string key="IBDocument.HIToolboxVersion">461.00</string>
+ <string key="IBDocument.SystemVersion">11C74</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1617</string>
+ <string key="IBDocument.AppKitVersion">1138.23</string>
+ <string key="IBDocument.HIToolboxVersion">567.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">301</string>
+ <string key="NS.object.0">534</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>IBProxyObject</string>
<string>IBUINavigationController</string>
<string>IBUIViewController</string>
<string>IBUICustomObject</string>
+ <string>IBUIToolbar</string>
<string>IBUIWindow</string>
<string>IBUINavigationBar</string>
<string>IBUINavigationItem</string>
@@ -78,16 +79,33 @@
<bool key="IBUIMultipleTouchEnabled">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
+ <object class="IBUIToolbar" key="IBUIToolbar" id="437225931">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{0, 436}, {320, 44}}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <int key="IBUIContentMode">4</int>
+ <bool key="IBUIMultipleTouchEnabled">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableArray" key="IBUIItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
<object class="NSMutableArray" key="IBUIViewControllers">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIViewController" id="619226028">
+ <reference key="IBUIToolbarItems" ref="0"/>
<object class="IBUINavigationItem" key="IBUINavigationItem" id="394667715">
<reference key="IBUINavigationBar"/>
<string key="IBUITitle">Azure Storage Client</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<reference key="IBUIParentViewController" ref="701001926"/>
<string key="IBUINibName">RootViewController</string>
+ <object class="IBUISimulatedToolbarMetrics" key="IBUISimulatedBottomBarMetrics"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
@@ -97,6 +115,7 @@
<bool key="IBUIHorizontal">NO</bool>
</object>
</object>
+ <bool key="IBUIToolbarHidden">NO</bool>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
@@ -167,6 +186,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="207850653"/>
<reference ref="619226028"/>
+ <reference ref="437225931"/>
</object>
<reference key="parent" ref="0"/>
</object>
@@ -189,42 +209,51 @@
<reference key="object" ref="394667715"/>
<reference key="parent" ref="619226028"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">17</int>
+ <reference key="object" ref="437225931"/>
+ <reference key="parent" ref="701001926"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
+ <string>-1.IBPluginDependency</string>
<string>-2.CustomClassName</string>
+ <string>-2.IBPluginDependency</string>
<string>11.IBPluginDependency</string>
<string>13.CustomClassName</string>
<string>13.IBPluginDependency</string>
+ <string>14.IBPluginDependency</string>
+ <string>17.IBPluginDependency</string>
<string>2.IBAttributePlaceholdersKey</string>
- <string>2.IBEditorWindowLastContentRect</string>
<string>2.IBPluginDependency</string>
<string>3.CustomClassName</string>
<string>3.IBPluginDependency</string>
- <string>9.IBEditorWindowLastContentRect</string>
<string>9.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIApplication</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UIResponder</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>RootViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<object class="NSMutableDictionary">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<reference key="dict.values" ref="0"/>
</object>
- <string>{{673, 376}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>Azure_Storage_ClientAppDelegate</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string>{{186, 376}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
@@ -240,7 +269,7 @@
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
- <int key="maxID">16</int>
+ <int key="maxID">18</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -293,7 +322,7 @@
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>login:</string>
- <string>start:</string>
+ <string>registration:</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -306,7 +335,7 @@
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>login:</string>
- <string>start:</string>
+ <string>registration:</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -315,7 +344,7 @@
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
- <string key="name">start:</string>
+ <string key="name">registration:</string>
<string key="candidateClassName">id</string>
</object>
</object>
@@ -324,17 +353,15 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <string>actionButton</string>
+ <string>activity</string>
<string>passwordField</string>
- <string>proxyLoginViewController</string>
- <string>proxySwitch</string>
- <string>proxyURLField</string>
<string>usernameField</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>UITextField</string>
- <string>UIViewController</string>
- <string>UISwitch</string>
+ <string>UIButton</string>
+ <string>UIActivityIndicatorView</string>
<string>UITextField</string>
<string>UITextField</string>
</object>
@@ -343,28 +370,23 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <string>actionButton</string>
+ <string>activity</string>
<string>passwordField</string>
- <string>proxyLoginViewController</string>
- <string>proxySwitch</string>
- <string>proxyURLField</string>
<string>usernameField</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
- <string key="name">passwordField</string>
- <string key="candidateClassName">UITextField</string>
+ <string key="name">actionButton</string>
+ <string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo">
- <string key="name">proxyLoginViewController</string>
- <string key="candidateClassName">UIViewController</string>
+ <string key="name">activity</string>
+ <string key="candidateClassName">UIActivityIndicatorView</string>
</object>
<object class="IBToOneOutletInfo">
- <string key="name">proxySwitch</string>
- <string key="candidateClassName">UISwitch</string>
- </object>
- <object class="IBToOneOutletInfo">
- <string key="name">proxyURLField</string>
+ <string key="name">passwordField</string>
<string key="candidateClassName">UITextField</string>
</object>
<object class="IBToOneOutletInfo">
@@ -392,6 +414,6 @@
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">301</string>
+ <string key="IBCocoaTouchPluginVersion">534</string>
</data>
</archive>

0 comments on commit e99cd62

Please sign in to comment.