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 need to add the <UIActionSheetDelegate> protocol in your .h file interface | |
| //@interface BIDViewController : UIViewController <UIActionSheetDelegate> | |
| //Action when a button is pressed | |
| - (IBAction)buttonPressed:(id)sender { | |
| UIActionSheet *actionSheet = [[UIActionSheet alloc] | |
| initWithTitle:@"Are you sure?" | |
| delegate:self | |
| cancelButtonTitle:@"No Way!" |
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
| //Check if a value exists in an NSMutableArray | |
| if ([mutableArray indexOfObject:@"value"] == NSNotFound) | |
| //Add rounded corners | |
| CALayer * shareViewLayer = shareBlogView.layer; | |
| [shareViewLayer setMasksToBounds:YES]; | |
| [shareViewLayer setCornerRadius:5.0]; | |
| //Add shadow to a view |
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
| //Create for every single view you're going to have a new view controller class | |
| //Subclass of UIViewController | |
| //With a correspoding .xib | |
| //. | |
| //Creating outlet for the root controller (which will be a tab bar) in the delegate .h file | |
| @property (strong, nonatomic) IBOutlet UITabBarController *tabBarController; | |
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; |
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
| //Drag a Table View object from the library onto the .xib (it will cover all the screen | |
| //Connect the dataSource and delegate outlets (from the connection inspector) | |
| //of the Table View component to the view controller (File's Owner) | |
| //Use those 2 protocols | |
| @interface TableExampleViewController : UIViewController<UITableViewDelegate, UITableViewDataSource> | |
| //The data themselves | |
| @property (strong, nonatomic) NSArray *colorNames; | |
| @property (strong, nonatomic) IBOutlet UITableView *mainTable; |
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
| //Create for every single view you're going to have a new view controller class | |
| //Subclass of UIViewController or UITableViewController if it's tableview based | |
| //With a correspoding .xib | |
| //Import the first view controller class that will be displayed in the .h file | |
| #import firstViewController.h | |
| //Creating outlet for the navigation controlle in the delegate .h file | |
| @property (strong, nonatomic) UINavigationController *navigationController; | |
| //OR (for the 2d way (look below) |
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
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
| // Override point for customization after application launch. | |
| /*****************************************************************************************/ | |
| //intialize the root controller, with the the SwitchView nib. | |
| self.webViewController = [[BIDWebViewController alloc] initWithNibName:@"Web" bundle: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
| Every application has 3 folders in it. | |
| 1. Documents: Where data are stored, except NSUserDefaults–based preference settings. | |
| 2. Library: NSUserDefaults–based preference settings are stored here | |
| 3. tmp: Temporary files are stored here. Files written into tmp will not be backed up by iTunes when your iOS device syncs. | |
| (You still need to delete these files to avoid filling up the file system.) | |
| /******************************************/ |
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
| An entity is made up of properties. There are three types of properties: | |
| Attributes: An attribute serves the same function in a Core Data entity as an instance variable does in an Objective-C class. | |
| They both hold the data. | |
| Relationships: As the name implies, a relationship defines the relationship between entities. | |
| For example, to create a Person entity, you might start by defining a few attributes such as hairColor, eyeColor, height | |
| and weight. You might define address attributes, such as state and ZIP code, or you might embed them in a separate HomeAddress | |
| entity. |
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
| /**************************************/ | |
| //Annotation object | |
| #import <Foundation/Foundation.h> | |
| #import <MapKit/MapKit.h> | |
| @interface MapViewAnnotation : NSObject <MKAnnotation> | |
| @property (nonatomic,strong) NSString *title; | |
| @property (nonatomic,strong) NSString *subtitle; | |
| @property (nonatomic, assign) CLLocationCoordinate2D coordinate; |