Skip to content

Instantly share code, notes, and snippets.

View thoretton-edwin's full-sized avatar

Edwin Thoretton thoretton-edwin

  • Slate Digital France
  • Grenoble
View GitHub Profile
@thoretton-edwin
thoretton-edwin / ImageViewExample.m
Last active August 29, 2015 13:56
iOS ImageView by file or url
// imgV1 is a UIImageView
-(IBAction)addImageView:(id)sender
{
NSLog(@"add image from repo");
if(imgV1==nil)
{
//just @"name" for png , other: @"name.extension"
UIImage* img = [UIImage imageNamed:@"image.jpg"];
@thoretton-edwin
thoretton-edwin / example.m
Last active August 29, 2015 13:56
iOS edit XML .plist file's data to NSMutableArray, NSDictionnary
//tab : NSMutableArray
tab = [[NSMutableArray alloc]initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"filename" ofType:@"plist"]];
@thoretton-edwin
thoretton-edwin / UIWindow
Created February 15, 2014 08:12
iOS Good Practice: to set frame of UIWindow
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
@thoretton-edwin
thoretton-edwin / TabBarController.m
Last active August 29, 2015 13:56
iOS TabBarController as rootViewController
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
self.tabBarController = [[UITabBarController alloc] init];
SquaresViewController *squaresViewController = [[SquaresViewController alloc] initWithNibName:@"SquaresViewController" bundle:nil];
@thoretton-edwin
thoretton-edwin / TableViewMethods.m
Last active August 29, 2015 13:56
iOS TableView cell methods with tab of NSDictionnary. tags : UITableView,UITableViewCell,cell,table view
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [tab count];
}