Created
February 17, 2010 15:39
-
-
Save jjthrash/306722 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Airship/StoreFront/UAInventory.m b/Airship/StoreFront/UAInventory.m | |
index 92563d0..9088f85 100644 | |
--- a/Airship/StoreFront/UAInventory.m | |
+++ b/Airship/StoreFront/UAInventory.m | |
@@ -55,9 +55,13 @@ | |
return productList; | |
} | |
+- (NSArray*)sortedKeys { | |
+ return [[productList allKeys] sortedArrayUsingSelector:@selector(compare:)]; | |
+} | |
+ | |
- (void)removeProduct:(NSString*)productId { | |
[productList removeObjectForKey: productId]; | |
- [keys setArray: [productList allKeys]]; | |
+ [keys setArray: self.sortedKeys]; | |
} | |
- (UAProduct*)productWithIdentifier:(NSString*)productId { | |
@@ -66,7 +70,7 @@ | |
- (void)addProduct:(UAProduct*)product { | |
[productList setObject: product forKey: product.productIdentifier]; | |
- [keys setArray: [productList allKeys]]; | |
+ [keys setArray: self.sortedKeys]; | |
} | |
- (int)count { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment