#ifdef _DEBUG
# define DLog(…) NSLog(__VA_ARGS__)
#else
# define DLog(…) /*..*/
#endif
add the above code to the pch file found in “Other Sources” section of your code.
the above code print the logs if _DEBUG is defined in our configuration.
we will define it only in debug configuration.
here is a video on how to do it.
http://www.screencast.com/t/hQcfyN0yKvNw
now the logs will be working only in debug profile and not when you work on a production profile.
after sometime i will tell you how to make a production profile or a distribution profile for installing app on devices.
#include “AppHelper.h”
#include “BaseViewController.h”
Note – pch file is found in “Other Sources” section of the app.
The whole project till now should look somewhat like this — WordPress.zip
- Xcode->File->New Project – > Navigation-based Application (a navigation based application is the one which makes the screens slide right to left when browsing the application)
- Name your project as WordPress.
- you will see an empty list if you run this project.
#import <UIKit/UIKit.h> // ———- import all the classes which apple has built for iphone development
@interface WordPressAppDelegate : NSObject <UIApplicationDelegate> { — // interface(definition) of WordPressAppDelegate class which inherits from NSObject class and conforms to UIApplicationDelegate, now conforming to a delegate means that this WordPressAppDelegate class can reply to some kind of messagess which some other class calls on this class like : –
– (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UIWindow *window; // a window needs to be added in every iphone object which will contain all the buttons,views,tablelist,images everything that a user will see and interact with.
UINavigationController *navigationController; // a navigation controller will contain all the view controllers, now a whenever you are on particular screen of your application, the whole data and views and everything you are seeing on a particular screen is managed by a view controller, when you press a button anywhere on a iphone screen and it takes you to another screen,that another screen is hanled by another viewcontroller. So all the ViewControllers are ordered and managed by a big father viewcontroller which is called navigationController.
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
@end