Hvor

Bitraf
Oslos største hackerspace

3D skrivere, CNC freser og elektronikk lab.

Workshops

Utleie av kontorplasser.

Hvem

Alexander Alemayhu
Utviklet mobile applikasjoner i snart 4 år.

HVA

  1. Objective-C
  2. UIKit
  3. Xcode

OBJECTIVE-C

  • Apples main programming language
  • Superset of C
  • OO



OO

*.h - header file (interface).
@interface Dogg : DangerousSpecie {
// Member variables/objects go in here
int dangerLevel;
}
//Method
-(void) attack;
*.m - source file(implementation)
@implementation Dogg
-(id) init {
if (self = [super init]) {
//Code omitted...
}
return self;
}
-(void) attack {
[self bite];
}
//Code omitted...
@end
        

Properties


@interface Dog : NSObject {
//Code omitted..
}
@property int dangerLevel;

@implementation Dog
@synthesize dangerLevel;
//Code omitted..
@end

Accessors


int danger = [dog dangerLevel];//Getter method
[dog setDangerLevel: 10];//Setter method


//C style
int d = dog.dangerLevel;
dog.dangerLevel = 10;

Protocol


@protocol UIApplicationDelegate<NSObject>
@optional
- (void)applicationDidFinishLaunching:(UIApplication *)application;
- (void)applicationDidBecomeActive:(UIApplication *)application;
- (void)applicationWillResignActive:(UIApplication *)application;
//Code omitted...
@end

Categories


@interface classToAddMethods(categoryName)
-(void) bark;
@end

@implementation classToAddMethods(categoryName)
-(void) bark
{
  NSLog(@"woof woof");
}
@end

UIKIT

Apples framework for constructing iOS graphical interfaces.

 It provides an application object, event handling, drawing model, windows, views, and controls specifically designed for a touch screen interface.

 

Apples IDE

Where to go from here


Bitraf

By Alexander Alemayhu