This file contains hidden or 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
| //So the datasource and delegate will be this view controller. | |
| //So drag and drop the picker outlets in the .xib to the File's Owner (this class) | |
| //Necessary Protocols | |
| //OR drag and drop the datasource and delegate from the connection inspector to the File's Owner | |
| @interface BIDViewController : UIViewController <UIPickerViewDelegate, UIPickerViewDataSource> | |
| @property (strong, nonatomic) IBOutlet UIPickerView *picker; | |
| @property (strong, nonatomic) IBOutlet UILabel *resultLabel; | |
| @property (strong, nonatomic) IBOutlet UITextField *dollarText; |
This file contains hidden or 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
| //You have to include MediaPlayer and MobileCoreServices frameworks to the project | |
| #import <UIKit/UIKit.h> | |
| //Needed protocols | |
| @interface BIDViewController : UIViewController <UIImagePickerControllerDelegate, UINavigationControllerDelegate> | |
| @property (weak, nonatomic) IBOutlet UIImageView *imageView; | |
| @property (weak, nonatomic) IBOutlet UIButton *takePictureButton; |
This file contains hidden or 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
| //WHAT IT LOOKS LIKE | |
| //Javascript and json objects are written inside "{ }" | |
| var bar = { name: "foo" , city: "SanDiego" }; | |
| var data = { sand: true , water:"Clear" , extra: bar }; //bar is the above object | |
| /*******************************************/ |
This file contains hidden or 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
| -(void)parseJSONFromURL:(NSString *)jsonURL { | |
| //Prepare URL request to get the user timeline | |
| NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:jsonURL]]; | |
| /*******************Sychronous Call Request**************/ | |
| //Perform request | |
| NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; | |
| /********************************************************/ |
This file contains hidden or 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
| Basics: | |
| Cells: cells are the content you wish to display, and inherits their format (bookshelf, circle, line, etc) from a layout that you specify | |
| Supplementary Views: supplementary views are views like labels and section headers/footers | |
| Decoration Views: decoration views are just that – decorations like a bookshelf graphic or a background | |
| --------- |
This file contains hidden or 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
| USE THIS: | |
| https://github.com/ccgus/fmdb | |
| A Cocoa / Objective-C wrapper around SQLite | |
| --------------------------------------------- | |
| OR: | |
| 1. Add libsqlite3.dylib to Frameworks |
This file contains hidden or 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
| //Touch events must be implemented in the class for ex. of the control that should handle it. If it doesn't it has to be | |
| //implemented in the parent class (ex. if not in the uicontrol, uibutton,table cell, tableview etc then it will go to UIView. | |
| //If UIView won't handle it, then it will go to the ViewController class. It can end up to the appdelegate class). | |
| //You have to call the parent's function that will implement the event manually | |
| //Four methods are used to notify a responder about touches. | |
| //When the user first touches the screen, the system looks for a responder that has a method called touchesBegan:withEvent: | |
| //Example | |
| - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event |
This file contains hidden or 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
| Localization folders have the format | |
| fr_FR.lproj -> ISOLanguage_ISOCountryCode.lproj | |
| Second try, will search: fr.lproj | |
| Third try, will search: fre.lproj | |
| -------------------- | |
| String Files: | |
| Named "Localizable.strings" and will be in each localization folder (in the finder - ex. en.lproj fr.lproj) | |
| //In the project thre will be at first 1 file that we'll have to localize for each language and edit each |
This file contains hidden or 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
| class Singleton { | |
| public: | |
| static Singleton* getInstance(); //This will get us the singleton class instance | |
| ~Singleton(); | |
| private: | |
| static Singleton* pInstance; //Flag if the instance already exists or not | |
| //Constructot must be private |
This file contains hidden or 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
| //Split Views consist of 2 views (view controllers). A mater view, which usually has a list if options to press) | |
| //and a detailed view which usually displays information based on what the user selected in the master view | |
| //When the iPad is in portrait mode the Split View Controller hides the master panel | |
| //so that the detail panel is able to utilize the entire screen. | |
| //In this case the master view appears as a popover | |
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; |