Changeset 652
- Timestamp:
- 01/15/10 11:41:22 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
apps/iphone/my.tel/trunk/Classes/RootViewController.m
r651 r652 22 22 - (id)initWithStyle:(UITableViewStyle)style { 23 23 if (self = [super initWithStyle:style]) { 24 self.currentAccountIndex = NS IntegerMax;24 self.currentAccountIndex = NSUIntegerMax; 25 25 [self loadData]; 26 26 } … … 125 125 } 126 126 127 - (NS Integer)currentAccountIndex {127 - (NSUInteger)currentAccountIndex { 128 128 return _currentAccountIndex; 129 129 } 130 130 131 - (void)setCurrentAccountIndex:(NS Integer)index {132 if ((index == NS IntegerMax) || (index != self.currentAccountIndex)) {131 - (void)setCurrentAccountIndex:(NSUInteger)index { 132 if ((index == NSUIntegerMax) || (index != self.currentAccountIndex)) { 133 133 mustLogin = YES; 134 134 } … … 137 137 138 138 - (void)loginToCurrentAccount { 139 if (self.currentAccountIndex == NS IntegerMax) {139 if (self.currentAccountIndex == NSUIntegerMax) { 140 140 // this happens when no account has been flagged as the current account 141 141 // for example upon startup of the app without any account setup … … 146 146 } 147 147 148 - (void)loginToAccountAtIndex:(NS Integer)accountIndex forced:(BOOL)forced{149 if (accountIndex == NS IntegerMax)148 - (void)loginToAccountAtIndex:(NSUInteger)accountIndex forced:(BOOL)forced{ 149 if (accountIndex == NSUIntegerMax) 150 150 return; 151 151 if ((accountIndex < 0) || (accountIndex >= [self.accountsArray count])) { 152 152 // bad index 153 self.currentAccountIndex = NS IntegerMax;153 self.currentAccountIndex = NSUIntegerMax; 154 154 return; 155 155 } … … 184 184 // Failed. Get back to the root 185 185 NSDictionary *failedAccount = self.currentAccount; 186 self.currentAccountIndex = NS IntegerMax;186 self.currentAccountIndex = NSUIntegerMax; 187 187 [self.navigationController popToRootViewControllerAnimated:NO]; 188 188 UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:[failedAccount objectForKey:@"accountLabel"] … … 196 196 } 197 197 198 - (void)displayControllerForAccountAtIndex:(NS Integer)accountIndex {198 - (void)displayControllerForAccountAtIndex:(NSUInteger)accountIndex { 199 199 NSString *accountLabel = [[self.accountsArray objectAtIndex:accountIndex] objectForKey:@"accountLabel"]; 200 200 AccountViewController *aVC = [AccountViewController controllerForAccountLabel:accountLabel]; … … 203 203 } 204 204 205 - (void)editAccountAtIndex:(NS Integer)accountIndex {205 - (void)editAccountAtIndex:(NSUInteger)accountIndex { 206 206 if (accountIndex >= [self.accountsArray count]) { 207 207 // invalid current account index … … 223 223 NSArray *indexPaths = [NSArray arrayWithObject:[NSIndexPath indexPathForRow:self.currentAccountIndex inSection:kKRootTableViewSectionAccounts]]; 224 224 [self.tableView deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationFade]; 225 self.currentAccountIndex = NS IntegerMax;225 self.currentAccountIndex = NSUIntegerMax; 226 226 [self saveData]; 227 227 } … … 307 307 break; 308 308 case kKRootTableViewSectionAddAccount: 309 self.currentAccountIndex = NS IntegerMax;309 self.currentAccountIndex = NSUIntegerMax; 310 310 eVC = [[AccountEditController new] autorelease]; 311 311 eVC.delegate = self; … … 371 371 [self.accountsArray exchangeObjectAtIndex:fromIndexPath.row withObjectAtIndex:toIndexPath.row]; 372 372 // Reset the current account 373 self.currentAccountIndex = NS IntegerMax;373 self.currentAccountIndex = NSUIntegerMax; 374 374 [self saveData]; 375 375 } … … 398 398 if (self.currentAccountIndex == thePath.row) { 399 399 // deleting current account 400 self.currentAccountIndex = NS IntegerMax;400 self.currentAccountIndex = NSUIntegerMax; 401 401 } else if (self.currentAccountIndex > thePath.row) { 402 402 // sync current account index








