1. Lậptrìnhứngdụng iPhone Truong QuocPhu <phutq8014@setacinq.com.vn> SETA:CINQ Vietnam, Ltd - 3D Building, Nguyen Phong Sac Str, CauGiay Dist, Ha Noi
2.
3.
4. Objectiv-C(3): Reference Counting Every object has a retain count Defined on NSObject As long as retain count is > 0, object is alive and valid +allocand -copy create objects with retain count == 1 -retain increments retain count -release decrements retain count When retain count reaches 0, object is destroyed -deallocmethod invoked automatically One-way street, once you’re in -dealloc there’s no turning back
5. Objectiv-C: Foundation Framework Foundation FW: là FW phát triển trên objective-c. Cung cấp tất cả các lớp cơ bản : string, number, collection, file , Tasks, timers, threads , File system, pipes, I/O, bundles NSObject Là lớp root Quản lý về bộ nhớ: init, dealloc
9. Objectiv-C: các kiểu dữ liệu cơ bản(4) NSNumber: Trong objective-c có thể dụng các kiểu dữ liệu số cơ bản trong C: int, float, double. NSNumber là kiểu dữ liệu số ở dạng object + (NSNumber *)numberWithInt:(int)value; + (NSNumber *)numberWithDouble:(double)value; - (int)intValue; - (double)doubleValue; NSData / NSMutableData Arbitrary sets of bytes NSDate / NSCalendarDate Times and dates http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC
12. Views UIView 1 hình khoảng vuông trên màn hình Nội dung được hiển thị trên đó Bắt các sự kiện 1 view có một superview 1 view không có hoặc có nhiều subview - (void)addSubview:(UIView *)view; - (void)removeFromSuperview; - (void)insertSubview:(UIView *)view atIndex:(int)index; - (void)insertSubview:(UIView *)view belowSubview:(UIView *)view; - (void)insertSubview:(UIView *)view aboveSubview:(UIView *)view;
21. ViewController:UINavigationController Là stack các viewcontroller Navigation bar Push to add a view controller - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated; Pop to remove a view controller - (void)popViewControllerAnimated:(BOOL)animated;
26. UITableViewDataSource Số lượng section trong table -(NSInteger)numberOfSectionsInTableView:(UITableView *)table Số cell trong 1 section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section; Hiện thị nội dung Cell - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; NSIndexPath: section , row
27. UITableView Delegate Xử lý các sự kiện trên table: click cell, sửa cell, xóa cell - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
28. UITableViewController Khi tạo UITableViewController sẽ tạo luông UITableview và kết hợp UITableViewDataSource và UITableView Delegate vào nội dung.
30. Sqlite Là kiểu database nhỏ, nhẹ thường được dùng trong các ứng dụng nhỏ, không cần sever. Cấu trúc truy vấn theo chuẩn của sql Quản lý file sqlite: add-on firefox SQLite Manager Khi sử dụng thêm thư viện libsqlite3.dylib
31. sqlite Open Database intsqlite3_open(const char *filename, sqlite3 **db); Query DB sqlite3_stmt *statement; sqlite3_prepare_v2(db,[sqlStringUTF8String],-1,&statement,nil); while (sqlite3_step(statement) == SQLITE_ROW) { int a =sqlite3_column_int(statement, 0); //with number nsstring *b = [NSString stringWithUTF8String:(char *) sqlite3_column_text(statement, 1); //with string } sqlite3_finalize(statement); Close DB sqlite3_close(db);