iPhone Foundation Framework
Upcoming SlideShare
Loading in...5
×
 

iPhone Foundation Framework

on

  • 580 views

 

Statistics

Views

Total Views
580
Views on SlideShare
431
Embed Views
149

Actions

Likes
1
Downloads
22
Comments
0

7 Embeds 149

http://aragornyeh.blogspot.tw 133
http://aragornyeh.blogspot.com 10
http://aragornyeh.blogspot.co.uk 2
http://aragornyeh.blogspot.de 1
http://aragornyeh.blogspot.in 1
http://aragornyeh.blogspot.mx 1
http://aragornyeh.blogspot.it 1
More...

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    iPhone Foundation Framework iPhone Foundation Framework Presentation Transcript

    • aragornyeh.blogspot.com
    • What is OS? Manage Device Hardware Provide basic technology for implementing Application
    • Cocoa Touch iPhone Programming
    • Cocoa Touch Multi-Touch Accelerometer View Hierarchy Localization Alerts Web View People Picker Image Picker
    • Cocoa Touch Frameworks UIKit Map Kit Web Kit focus on touch-based interfaces
    • 2 Media iPhone Programming
    • Media Core Audio Open AL Audio Mixing Audio Recording Video Playback JPG, PNG, TIFF PDF Quartz Core Animation OpenGL ES
    • Media Frameworks Core Graphic Core Animation OpenGL / OpenAL Core Audio Media Player focus on Multimedia services
    • Core Services iPhone Programming
    • Core Services Collections Address Book Networking File Access SQLite Core Location Net Services Threading Preferences URL Utilities
    • Core Service Frameworks Core Data Core Foundation Core Location Store Kit SQLite / XML
    • Core OS iPhone Programming
    • Core OS OS X Kernel Mach 3.0 BSD Socket Security Power Mgmt Keychain Certificate File System Bonjour
    • Core OS CFNetwork Security System External Accessory
    • What are the 4 layers in iPhone OS?
    • Layer = Groups of Framework OS interfaces in special package A set of APIs and Classes Link it into your application!
    • Framework the underlying structure; a structure supporting or containing something
    • Build a House
    • Build App with iOS Frameworks
    • Foundation framework iPhone Programming
    • Foundation Classes NSObject NSString NSNumber NSData NSDate NSURL NSArray NSDictionary NSSet
    • NSObject is the root class of all Creation – alloc, init Equality – isEqual: Memory management – retain, release, autorelease
    • NSNumber Defines methods to access as int float, double char BOOL
    • NSNumber example NSNumber *intNumber; int myInt; intNumber = [NSNumber numberWithInteger:100]; myInt = [intNumber integerValue]; NSLog (@"%i", myInt);
    • Ideone.com
    • PRACTICE NS_NUMBER1
    • NSString: Encapsulation of String
    • NSString example #import <Foundation/Foundation.h> int main(){ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc]init]; NSString *str = @"hello"; NSLog(@"%@", str); [pool drain]; return 0; }
    • NSString example NSString *aString = @"Hello World!"; NSString *log = [NSString stringWithFormat: @"It’s %@", aString];
    • NSString example NSString *myString = @"Hello"; NSString *fullString; fullString = [myString stringByAppendingString:@"world!"];
    • NSString Method - (BOOL)isEqualToString:(NSString *)string; - (BOOL)hasPrefix:(NSString *)string; - (int)intValue; - (double)doubleValue;
    • NSString example NSString *myString = @”Hello”; if ([myString hasPrefix:@”He”]) { ……………………………………………………………. }
    • NSString example NSString *otherString = @”449”; if ([otherString intValue] > 500) { ……………………………………………………………….. }
    • NSMutableString example NSMutableString *newString = [NSMutableString string]; [newString appendString:@"Hi"]; [newString appendFormat:@", my favorite number is: %d", 128]];
    • PRACTICE NS_MUTABLE_STRING
    • Array
    • NSArray An ordered list of Objects
    • NSArray example NSArray *array = [NSArray arrayWithObjects:@"Red", @"Blue", @"Green", nil]; if([array indexOfObject:@"Purple"] == NSNotFound) { NSLog (@"No color purple"); }
    • NSNotFound Value that indicates an item did not exist Used by search methods in array
    • NSArray example Person *p1 = [[Person alloc] initWithName:@"Sally"]; Person *p2 = [[Person alloc] initWithName:@"Fred"]; NSArray *students = [NSArray arrayWithObjects:p1, p2, nil];
    • PRACTICE NS_STRING3
    • NSMutableArray example NSMutableArray *nums = [NSMutableArray arrayWithObjects:@”one”, @”two”, nil]; - (void)insertObject:(id)object atIndex:(NSUInteger)idx; - (void)removeObject:(id)object;
    • PRACTICE NS_MUTABLE_ARRAY
    • Dictionary
    • NSDictionary Collections of Keys and Values
    • NSDictionary Key is NSString Value is id
    • NSDictionary example NSDictionary *colors = [NSDictionary dictionaryWithObjectsAndKeys:@"Red", @"Color 1", @"Green", @"Color 2", @"Blue", @"Color 3", nil]; NSString *firstColor = [colors objectForKey:@"Color 1"];
    • NSMutableDictionary Example NSMutableDictionary *bestFriends = [NSMutableDictionary dictionary]; [bestFriends setObject:@”fred” forKey:@”sally”]; [bestFriends setObject:@”frank” forKey:@”sally”];
    • PRACTICE NS_MUTABLE_DICTIONARY
    • NSSet Collection of unordered objects
    • Creating some objects NSString +stringWithFormat: NSArray +arrayWithObjects: NSDictionary +dictionaryWithObjectsAndKeys:
    • NSDate NSDate *date = [NSDate date];
    • Further Reading Collections Programming Topics
    • 2 UIKit framework iPhone Programming
    • iPhone Programming is Easy! Questions? aragornyeh@gmail.com