Permalink
Browse files

read setting for username and added debug flag for devlog

  • Loading branch information...
1 parent 027b555 commit fa3d4a0304f90656ed25691e77b786d7844f1bed @sschroed committed Jan 16, 2009
Showing with 34 additions and 6 deletions.
  1. +2 −0 Classes/RootViewController.h
  2. +13 −5 Classes/RootViewController.m
  3. +5 −1 git-phone.xcodeproj/project.pbxproj
  4. +14 −0 git_phone_Prefix.pch
@@ -9,6 +9,8 @@
#import <UIKit/UIKit.h>
@interface RootViewController : UITableViewController {
+
+ NSString *gitHubUserName;
}
@end
@@ -12,14 +12,22 @@
@implementation RootViewController
-/*
+- (void) loadPrefs {
+ // read user prefs
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+ gitHubUserName = [defaults stringForKey:@"GitHubUserName"];
+}
+
- (void)viewDidLoad {
[super viewDidLoad];
-
- // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
+ [self loadPrefs];
+
+ DevLog2(@"username: %@", gitHubUserName);
+
+ // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
-*/
+
/*
- (void)viewWillAppear:(BOOL)animated {
@@ -131,8 +139,8 @@ - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)
}
*/
-
- (void)dealloc {
+ [gitHubUserName release];
[super dealloc];
}
@@ -228,8 +228,12 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
+ OTHER_CFLAGS = (
+ "-D",
+ __DEBUG__,
+ );
PREBINDING = NO;
- SDKROOT = iphoneos2.2;
+ SDKROOT = iphonesimulator2.2;
};
name = Debug;
};
View
@@ -6,3 +6,17 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif
+
+// -----------------------------------------------------------------------------
+#pragma mark -
+#pragma mark Development Logging
+
+#ifdef __DEBUG__
+#define DevLog(a) NSLog(a)
+#define DevLog2(a, b) NSLog(a, b)
+#define DevLog3(a, b, c) NSLog(a, b, c)
+#else
+#define DevLog(a)
+#define DevLog2(a, b)
+#define DevLog3(a, b, c)
+#endif

0 comments on commit fa3d4a0

Please sign in to comment.