SlideShare uma empresa Scribd logo
1 de 67
Baixar para ler offline
iOS Basic Development
User Selection Design
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Social Share
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
UIActionSheet
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
- (IBAction)shareSocial:(id)sender {
UIActionSheet *action = [[UIActionSheet alloc]initWithTitle:@"Social Network"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"Facebook",@"Twitter",
@"Instagram",@"Email", nil];
[action showInView:self.view];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(buttonIndex == 0){
[self directShareFacebook:nil];
}
if(buttonIndex == 1){
[self directShareTwitter:nil];
}
if(buttonIndex == 2){
[self directShareInstagram:nil];
}
if(buttonIndex == 3){
[self directSendMail:nil];
}
}
UIActionSheet
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Social Framework
Facebook
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
- (IBAction)directShareFacebook:(id)sender {
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
{
SLComposeViewController *composeVC =
[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[composeVC setInitialText:self.myTextView.text];
UIImage *image = self.myImageView.image;
[composeVC addImage:image];
NSURL *url = [NSURL URLWithString:@"http://www.ibluecode.com"];
[composeVC addURL:url];
[self presentViewController:composeVC
animated:YES
completion:nil];
}
}
SLComposeViewController : Facebook
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Social Framework
Twitter
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
- (IBAction)directShareTwitter:(id)sender {
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
SLComposeViewController *composeVC =
[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
[composeVC setInitialText:self.myTextView.text];
UIImage *image = self.myImageView.image;
[composeVC addImage:image];
NSURL *url = [NSURL URLWithString:@"http://www.ibluecode.com"];
[composeVC addURL:url];
[self presentViewController:composeVC
animated:YES
completion:nil];
}
}
SLComposeViewController :Twitter
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
UIDocumentInteractionController
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
- (IBAction)openDocumentAction:(id)sender {
NSURL *url = [[NSBundle mainBundle] URLForResource:@"mac_pro" withExtension:@"jpg"];
self.docController = [UIDocumentInteractionController interactionControllerWithURL:url];
self.docController.delegate = self ;
BOOL isValid = [[UIApplication sharedApplication] canOpenURL:url];
NSLog(@"uti: %@", [self.docController UTI]);
if(isValid){
[self.docController presentOptionsMenuFromRect:self.view.frame
inView:self.view
animated:YES];
}
}
UIDocumentInteractionController :All
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
- (IBAction)directShareInstagram:(id)sender {
NSURL *instagramURL = [NSURL URLWithString:@"instagram://location?id=1"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@"Image.igo"];
NSData *imageData = UIImagePNGRepresentation(self.myImageView.image);
[imageData writeToFile:savedImagePath atomically:YES];
NSURL *imageUrl = [NSURL fileURLWithPath:savedImagePath];
NSLog(@"%@",imageUrl);
UIDocumentInteractionController *docController = [UIDocumentInteractionController new];
docController.delegate = self;
docController.UTI = @"com.instagram.exclusivegram";
docController.URL = imageUrl;
[docController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
}else{
[self showAlertView:@"Please install Instagram before share."];
}
}
UIDocumentInteractionController : Instagram
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
UIAlertView
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
-(void)showAlertView:(NSString*)title
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title
message:@""
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[alert show];
}
UIAlertView
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
MFMailComposeViewController
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
- (IBAction)directSendMail:(id)sender {
if ([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *mailVC = [[MFMailComposeViewController alloc] init];
mailVC.mailComposeDelegate = self;
[mailVC setSubject:@"Subject"];
NSArray *toRecipients = [NSArray arrayWithObjects:
@"eak.k@ibluecode.com",
@"eakkattiya@gmail.com", nil];
[mailVC setToRecipients:toRecipients];
UIImage *myImage = self.myImageView.image ;
NSData *imageData = UIImagePNGRepresentation(myImage);
[mailVC addAttachmentData:imageData mimeType:@"image/png" fileName:@"attachment"];
NSString *emailBody = self.myTextView.text;
[mailVC setMessageBody:emailBody isHTML:NO];
//iOS 5
//[self presentModalViewController:mailer animated:YES];
//iOS 6
[self presentViewController:mailVC animated:YES completion:nil];
}
}
MFMailComposeViewController
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
UIPickerView
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Class : UIPickerView
Framework : UIKit
Sample Code : UICatalog
Init : initWithFrame : (CGRect) or Interface Builder
Datasource : – numberOfComponentsInPickerView:
– pickerView:numberOfRowsInComponent:
Delegate : – pickerView:titleForRow:forComponent:
– pickerView:viewForRow:forComponent:reusingView:
– pickerView:didSelectRow:inComponent:
UIPickerView
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
การเรียกใช้งาน
1. Init UIPickerView
2. bind Datasouce / Delegate
3. กําหนดคอลัมน์
numberOfComponentsInPickerView
4. กําหนดจํานวนแถว
pickerView:numberOfRowsInComponent:
5. กําหนดการแสดงค่าเป็น Text หรือView ได้
pickerView:titleForRow:forComponent:
pickerView:viewForRow:forComponent:reusingView:
6. ใช้ Delegate เมื่อเลือกข้อมูลเสร็จ
pickerView:didSelectRow:inComponent
UIPickerView
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
1. Init UIPickerView (.h)
IBOutlet UIPickerView *myPV ;
2. bind Datasouce / Delegate (.m)
[myPV setDataSource:self];
[myPV setDelegate:self];
[myPV selectRow:0 inComponent:0 animated:NO];
[myPV selectRow:0 inComponent:1 animated:NO];
[myPV selectRow:0 inComponent:2 animated:NO];
UIPickerView
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
3. กําหนดคอลัมน์ (.m)
- (NSInteger)numberOfComponentsInPickerView:
(UIPickerView *)pickerView;
{
return 3 ;
}
4. กําหนดจํานวนแถว (.m)
- (NSInteger)pickerView:(UIPickerView *)pickerView
numberOfRowsInComponent:(NSInteger)component;
{
if(component == 1){
return 20 ;
}
if(component == 0){
return 30 ;
}
return 10 ;
}
UIPickerView
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
5. กําหนดการแสดงค่าเป็น Text หรือView ได้ (.m)
#pragma แสดงค&าเป*น Text
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:
(NSInteger)row forComponent:(NSInteger)component;
{
NSMutableArray *arrayNo1 = [[NSMutableArray alloc] init];
[arrayNo1 addObject:@"0"];
[arrayNo1 addObject:@"1"];
[arrayNo1 addObject:@"2"];
[arrayNo1 addObject:@"3"];
[arrayNo1 addObject:@"4"];
[arrayNo1 addObject:@"5"];
[arrayNo1 addObject:@"6"];
[arrayNo1 addObject:@"7"];
[arrayNo1 addObject:@"8"];
[arrayNo1 addObject:@"9"];
return [arrayNo1 objectAtIndex:row];
}
UIPickerView
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
5. กําหนดการแสดงค่าเป็น Text หรือView ได้ (.m)
#pragma แสดงค&าเป*นรูปภาพ
- (UIView *)pickerView:(UIPickerView *)pickerView
viewForRow:(NSInteger)row
forComponent:(NSInteger)component
reusingView:(UIView *)view
{
NSString *imageName = [NSString stringWithFormat:@"%d.png",row];
UIImageView *bgImageView = [[UIImageView alloc]initWithImage:
[UIImage imageNamed:imageName]];
[bgImageView setFrame:CGRectMake(0, 0, 50, 50)];
[bgImageView setContentMode:UIViewContentModeScaleAspectFit];
return bgImageView;
}
UIPickerView
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
6. ใช้ Delegate เมื่อเลือกข้อมูลเสร็จ
- (void)pickerView:(UIPickerView *)pickerView
didSelectRow:(NSInteger)row
inComponent:(NSInteger)component
{
if(component == 0){
inputCol1 = [arrayNo1 objectAtIndex:row];
}
else if(component == 1){
inputCol2 = [arrayNo2 objectAtIndex:row];
}
else if(component == 2){
inputCol3 = [arrayNo3 objectAtIndex:row];
}
}
UIPickerView
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Top Secret
Saturday, June 15, 13
Workshop : Top Secret
Task : สร้างหน้าจอ Login Password
โดย User ต้องทําการเลือก Password =246
จาก UIPickerView จากนั้นจึงเข้าสู่หน้าจอต่อไป
สามารถ Reset ค่าได้จากปุ่ม RESET BUTTON
Objective : นักเรียนมีความเข้าใจในเรื่อง
UIViewController
User Interface และ IBOutlet
Action-Target
Datasouce
Delegate
UIPickerView
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
iOS Basic Development
Submit App Store
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Course Outline
1. Introduction & Xcode
2. Objective-C & Frameworks
3. View &ViewController
4. View &ViewController (2)
5. Submit App Store
Course Outline
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Developing iOS Apps :App Store
Add New Application ( iTunes Connect )
Upload required icon and screenshots
Upload Application Binary ( IPA File )
Waiting for app review by apple ( 7 days - Few months)
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
หลังจากที่นักเรียนได้เรียนรู้การพื้นฐานการเขียนโปรแกรม
บน iPhone และการใช้Tool ต่าง ๆ ไปเรียบร้อยแล้ว
นักเรียนก็ทําการเขียนโปรแกรมได้อย่างราบรื่น ระหว่างที่
เขียน Code นั้นก็ไม่มี Error อะไร สามารถ Compile และ
Run Application ได้โดยไม่มีการ Crash ของโปรแกรมและ
การทํางานต่าง ๆ นั้นรวดเร็วถูกต้องตามที่ออกแบบไว้ทุก
ประการ.....
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
หลังจากที่นักเรียนได้เรียนรู้การพื้นฐานการเขียนโปรแกรม
บน iPhone และการใช้Tool ต่าง ๆ ไปเรียบร้อยแล้ว
นักเรียนก็ทําการเขียนโปรแกรมได้อย่างราบรื่น ระหว่างที่
เขียน Code นั้นก็ไม่มี Error อะไร สามารถ Compile และ
Run Application ได้โดยไม่มีการ Crash ของโปรแกรมและ
การทํางานต่าง ๆ นั้นรวดเร็วถูกต้องตามที่ออกแบบไว้ทุก
ประการ.....
ใช่หรือไม่ ?
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
โดยปกติแล้วขั้นตอนการเขียนโปรแกรม
ระหว่างที่ ทําการ Build & Run จะเป็นเช่นนี้
1. Error ! (ไม่สามารถ ทําการ Build ได้)
2.Warning ! (ไม่ Error แต่มีการเตือน)
3. Crash ! (Build ได้แต่ Run ไม่ได้)
4.Wrong ! (Run ได้แต่ทํางานผิด)
5. Slow ! (ทํางานถูกแต่ช้า ไม่ลื่น)
6.Work ! (ทํางานได้ถูกและเร็ว)
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
เนื่องจากเราไม่สามารถเขียนโปรแกรมเพียง
ครั้งเดียวให้ทํางานได้ถูกต้องสมบูรณ์ได้ ดัง
นั้นจึงต้องมีวิธีการตรวจสอบการทํางานของ
โปรแกรมไปทีละขั้น ซึ่งเราเรียกว่าการ
Debugging
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Debugging
คือโหมดการ Run Application ไปทีละขั้นเพื่อดูทํางานของ
Application ในจุดที่เราสนใจว่าทํางานได้ถูกต้องตามที่เรา
ต้องการหรือไม่ โดยขั้นตอนดังนี้
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Debugging
- เพิ่ม-ลบ breakpoints เพื่อหยุดโปรแกรมในจุดที่เราสนใจ
- ดูค่าในตัวแปรต่าง ๆ ได้โดยการเอา Mouse ไปชี้
- Run แบบ Step in ,Step Out เพื่อตรวจสอบขั้นตอนการ
ทํางานของโปรแกรม
- NSLog เพื่อแสดงข้อมูลต่าง ๆ บนหน้าต่าง Console
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Understanding Errors
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Understanding Errors
บทนี้จะอธิบายความหมายของ Error ต่าง ๆ ที่มักเจอบ่อยซึ่ง
จะช่วยให้เราแก้ปัญหาได้รวดเร็วขึ้น และสามารถทําการ
Build โปรแกรมได้
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Understanding Errors
Expected ‘;’ before ...
สาเหตุ :
- ลืมใส่ ; ปิดประโยค
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Understanding Errors
‘Something’ Undeclared
ไม่สามารถหาที่มาของ Class Something ที่เราเรียกใช้ได้
สาเหตุ :
- เขียนชื่อ Class ผิด เช่น ตัวเล็ก–ใหญ่
- ไม่ได้ import file หรือ import file ผิด
- ไม่ได้ทําการ import Framework , library
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Understanding Errors
Statically allocated instance of Objective-C class
สาเหตุ :
- ลืมใส่ * ให้กับ Object ที่เป็นประเภท Dynamic
เช่น
NSString myString ;
ที่ถูกคือ
NSString *myString ;
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Understanding Crash Problem
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Understanding Crash Problem
หลังจากที่เราแก้ Error และสามารถ Run โปรแกรมได้แล้วจะ
พบว่าโปรแกรมเกิดการ Crash ในระหว่างที่ทํางาน โดยบทนี้
จะอธิบายการเกิด Crash ที่มักเจอได้บ่อย
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Understanding Crash Problem
“EXC_BAD_ACCESS”
สาเหตุ :
- ทําการเรียก Object ที่ถูก release ไปแล้ว
เช่น
NSString *myString ;
[myString release] ; // ไม่มี object แล้ว
myString = @”Test” ;
การแก้ไข :
- Debug ทีละขั้น หรือ ใช้เครื่องมือ Instruments ตรวจหา
Zombies Object
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Understanding Crash Problem
“SIGABRT” = SIGNAL ABORT
เป็นคําสั่งให้หยุดการทํางานของโปรแกรมเนื่องจากพบ Error
สาเหตุ :
- ทําการเรียก Method ที่ไม่มีอยู่ หรือ เรียกผิด เช่น
NSString *myString ;
myString = @”Test” ;
[myString releasee] ;
// Method releasee นั้นไม่มีใน Class
การแก้ไข :
- Debug ทีละขั้น และตรวจสอบ Warning
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Understanding Interface Builder Error
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Understanding Interface Builder Error:
บางครั้งการ Crash โปรแกรมเกิดจากการที่เราแก้ไข file
XIB ใน Interface Builder ได้เช่นกัน
สาเหตุ :
- กําหนด Class ผิดประเภท
วิธีแก้ไข :
- เปิดหน้าต่าง Console แล้วดูบรรทัดล่าสุดจะบอกราย
ละเอียดของ Class ที่ Error อยู่แล้วทําการแก้ไขให้ถูกต้อง
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Workshop
ให้นักเรียนทํา Project ของตัวเองแล้วทดลอง Debug และ
แก้ไข Error ต่าง ๆ ที่เกิดขึ้น
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
PerformanceTool
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
PerformanceTool
- Clang Analyzer
- Instruments
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Clang Analyzer
เป็นเครื่องมือในการวิเคราะห์ Code ของเราก่อนทําการ Run
ว่าเขียนได้มีประสิทธิภาพหรือไม่ เช่น
- ตรวจสอบจุดที่น่าจะเกิด Memory Leaked ได้
- ตรวจสอบตัวแปรที่ไม่ถูกเรียกใช้
- เรียกใช้ได้จาก menu Build and Analyze
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Instruments
เป็นเครื่องมือในการทดสอบ Performance ขณะที่ Run
โปรแกรม
- ตรวจสอบจุดที่เกิด Memory Leaked
- ตรวจสอบการจองหน่วยความจํา
- ตรวจสอบ Zombie Object
(Object ที่ตายหรือถูก Release ไปแล้วแต่มีการเรียกใช้อีก
เปรียบเสมือน Zombie ที่ตายแล้วถูกเรียกปลุกขึ้นมาใหม่)
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Workshop
ให้นักเรียนทําการTest Performance Project ของตัวเอง
ด้วยเครื่องมือ Analyzer และ Instruments
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Submit AppStore
- เปิดตัววันที่ 10 July 2008
- เป็นครั้งแรกและเป็นช่องทางที่ง่ายที่สุดที่จะทําให้นักพัฒนา
สามารถขาย Application ให้กับคน 155 ประเทศทั่วโลก
- ผู้ใช้ 400 ล้านคนที่ีมีบัตร Credit
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Submit AppStore
5-March-2012
- จํานวน App รวม (iPhone/iPad/iPodTouch) คือ 550,000+
- จํานวน App บน iPad คือ 170,000 +
- ยอด AppStore Download 25,000 ล้านครั้ง
12-June-2012
- ปัจจุบันจํานวน App รวม (iPhone/iPad/iPodTouch) คือ 650,000+
- จํานวน App บน iPad คือ 225,000 +
- ยอด AppStore Download 30,000 ล้านครั้ง
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
Submit AppStore
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
In-App Purchases (Freemium Model)
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
In-App Purchases (TinyTower)
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
In-App Purchases
Order and Chaos NBA Jam
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
In-App Purchases (The SmurfsVillage)
8-Year-Old Girl Racks Up $1400 Bill Buying Smurfberries in Smurf'sVillage
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
In-App Purchases (Restrictions)
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13
by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111
Saturday, June 15, 13

Mais conteúdo relacionado

Destaque (12)

Pristine sun teaser 1Q 2015
Pristine sun teaser 1Q 2015Pristine sun teaser 1Q 2015
Pristine sun teaser 1Q 2015
 
Go big now
Go big nowGo big now
Go big now
 
Pastoralegiovanile4
Pastoralegiovanile4Pastoralegiovanile4
Pastoralegiovanile4
 
Skif lan
Skif lanSkif lan
Skif lan
 
2013 nederland-jeugdwerkloosheid
2013 nederland-jeugdwerkloosheid2013 nederland-jeugdwerkloosheid
2013 nederland-jeugdwerkloosheid
 
2013 sectoren-ecabo-werknemers-ict-ss
2013 sectoren-ecabo-werknemers-ict-ss2013 sectoren-ecabo-werknemers-ict-ss
2013 sectoren-ecabo-werknemers-ict-ss
 
Pastoralegiovanile2
Pastoralegiovanile2Pastoralegiovanile2
Pastoralegiovanile2
 
Diana .
Diana .Diana .
Diana .
 
Pastoralegiovanile1
Pastoralegiovanile1Pastoralegiovanile1
Pastoralegiovanile1
 
Las rique zas de mi peru
Las   rique zas  de mi  peruLas   rique zas  de mi  peru
Las rique zas de mi peru
 
Tazkirah ramadhan
Tazkirah ramadhanTazkirah ramadhan
Tazkirah ramadhan
 
Skor A+ sejarah STPM
Skor A+ sejarah STPMSkor A+ sejarah STPM
Skor A+ sejarah STPM
 

(1 July 2013) iOS Basic Development Day 5 - Submit to App Store

  • 1. iOS Basic Development User Selection Design by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 2. Social Share by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 3. UIActionSheet by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 4. - (IBAction)shareSocial:(id)sender { UIActionSheet *action = [[UIActionSheet alloc]initWithTitle:@"Social Network" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Facebook",@"Twitter", @"Instagram",@"Email", nil]; [action showInView:self.view]; } -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if(buttonIndex == 0){ [self directShareFacebook:nil]; } if(buttonIndex == 1){ [self directShareTwitter:nil]; } if(buttonIndex == 2){ [self directShareInstagram:nil]; } if(buttonIndex == 3){ [self directSendMail:nil]; } } UIActionSheet by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 5. Social Framework Facebook by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 6. - (IBAction)directShareFacebook:(id)sender { if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) { SLComposeViewController *composeVC = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; [composeVC setInitialText:self.myTextView.text]; UIImage *image = self.myImageView.image; [composeVC addImage:image]; NSURL *url = [NSURL URLWithString:@"http://www.ibluecode.com"]; [composeVC addURL:url]; [self presentViewController:composeVC animated:YES completion:nil]; } } SLComposeViewController : Facebook by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 7. Social Framework Twitter by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 8. - (IBAction)directShareTwitter:(id)sender { if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) { SLComposeViewController *composeVC = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter]; [composeVC setInitialText:self.myTextView.text]; UIImage *image = self.myImageView.image; [composeVC addImage:image]; NSURL *url = [NSURL URLWithString:@"http://www.ibluecode.com"]; [composeVC addURL:url]; [self presentViewController:composeVC animated:YES completion:nil]; } } SLComposeViewController :Twitter by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 9. UIDocumentInteractionController by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 10. - (IBAction)openDocumentAction:(id)sender { NSURL *url = [[NSBundle mainBundle] URLForResource:@"mac_pro" withExtension:@"jpg"]; self.docController = [UIDocumentInteractionController interactionControllerWithURL:url]; self.docController.delegate = self ; BOOL isValid = [[UIApplication sharedApplication] canOpenURL:url]; NSLog(@"uti: %@", [self.docController UTI]); if(isValid){ [self.docController presentOptionsMenuFromRect:self.view.frame inView:self.view animated:YES]; } } UIDocumentInteractionController :All by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 11. - (IBAction)directShareInstagram:(id)sender { NSURL *instagramURL = [NSURL URLWithString:@"instagram://location?id=1"]; if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) { NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@"Image.igo"]; NSData *imageData = UIImagePNGRepresentation(self.myImageView.image); [imageData writeToFile:savedImagePath atomically:YES]; NSURL *imageUrl = [NSURL fileURLWithPath:savedImagePath]; NSLog(@"%@",imageUrl); UIDocumentInteractionController *docController = [UIDocumentInteractionController new]; docController.delegate = self; docController.UTI = @"com.instagram.exclusivegram"; docController.URL = imageUrl; [docController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES]; }else{ [self showAlertView:@"Please install Instagram before share."]; } } UIDocumentInteractionController : Instagram by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 12. UIAlertView by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 13. -(void)showAlertView:(NSString*)title { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:@"" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil]; [alert show]; } UIAlertView by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 14. MFMailComposeViewController by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 15. - (IBAction)directSendMail:(id)sender { if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mailVC = [[MFMailComposeViewController alloc] init]; mailVC.mailComposeDelegate = self; [mailVC setSubject:@"Subject"]; NSArray *toRecipients = [NSArray arrayWithObjects: @"eak.k@ibluecode.com", @"eakkattiya@gmail.com", nil]; [mailVC setToRecipients:toRecipients]; UIImage *myImage = self.myImageView.image ; NSData *imageData = UIImagePNGRepresentation(myImage); [mailVC addAttachmentData:imageData mimeType:@"image/png" fileName:@"attachment"]; NSString *emailBody = self.myTextView.text; [mailVC setMessageBody:emailBody isHTML:NO]; //iOS 5 //[self presentModalViewController:mailer animated:YES]; //iOS 6 [self presentViewController:mailVC animated:YES completion:nil]; } } MFMailComposeViewController by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 16. UIPickerView by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 17. Class : UIPickerView Framework : UIKit Sample Code : UICatalog Init : initWithFrame : (CGRect) or Interface Builder Datasource : – numberOfComponentsInPickerView: – pickerView:numberOfRowsInComponent: Delegate : – pickerView:titleForRow:forComponent: – pickerView:viewForRow:forComponent:reusingView: – pickerView:didSelectRow:inComponent: UIPickerView by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 18. การเรียกใช้งาน 1. Init UIPickerView 2. bind Datasouce / Delegate 3. กําหนดคอลัมน์ numberOfComponentsInPickerView 4. กําหนดจํานวนแถว pickerView:numberOfRowsInComponent: 5. กําหนดการแสดงค่าเป็น Text หรือView ได้ pickerView:titleForRow:forComponent: pickerView:viewForRow:forComponent:reusingView: 6. ใช้ Delegate เมื่อเลือกข้อมูลเสร็จ pickerView:didSelectRow:inComponent UIPickerView by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 19. 1. Init UIPickerView (.h) IBOutlet UIPickerView *myPV ; 2. bind Datasouce / Delegate (.m) [myPV setDataSource:self]; [myPV setDelegate:self]; [myPV selectRow:0 inComponent:0 animated:NO]; [myPV selectRow:0 inComponent:1 animated:NO]; [myPV selectRow:0 inComponent:2 animated:NO]; UIPickerView by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 20. 3. กําหนดคอลัมน์ (.m) - (NSInteger)numberOfComponentsInPickerView: (UIPickerView *)pickerView; { return 3 ; } 4. กําหนดจํานวนแถว (.m) - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component; { if(component == 1){ return 20 ; } if(component == 0){ return 30 ; } return 10 ; } UIPickerView by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 21. 5. กําหนดการแสดงค่าเป็น Text หรือView ได้ (.m) #pragma แสดงค&าเป*น Text - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow: (NSInteger)row forComponent:(NSInteger)component; { NSMutableArray *arrayNo1 = [[NSMutableArray alloc] init]; [arrayNo1 addObject:@"0"]; [arrayNo1 addObject:@"1"]; [arrayNo1 addObject:@"2"]; [arrayNo1 addObject:@"3"]; [arrayNo1 addObject:@"4"]; [arrayNo1 addObject:@"5"]; [arrayNo1 addObject:@"6"]; [arrayNo1 addObject:@"7"]; [arrayNo1 addObject:@"8"]; [arrayNo1 addObject:@"9"]; return [arrayNo1 objectAtIndex:row]; } UIPickerView by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 22. 5. กําหนดการแสดงค่าเป็น Text หรือView ได้ (.m) #pragma แสดงค&าเป*นรูปภาพ - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { NSString *imageName = [NSString stringWithFormat:@"%d.png",row]; UIImageView *bgImageView = [[UIImageView alloc]initWithImage: [UIImage imageNamed:imageName]]; [bgImageView setFrame:CGRectMake(0, 0, 50, 50)]; [bgImageView setContentMode:UIViewContentModeScaleAspectFit]; return bgImageView; } UIPickerView by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 23. 6. ใช้ Delegate เมื่อเลือกข้อมูลเสร็จ - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { if(component == 0){ inputCol1 = [arrayNo1 objectAtIndex:row]; } else if(component == 1){ inputCol2 = [arrayNo2 objectAtIndex:row]; } else if(component == 2){ inputCol3 = [arrayNo3 objectAtIndex:row]; } } UIPickerView by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 24. by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Top Secret Saturday, June 15, 13
  • 25. Workshop : Top Secret Task : สร้างหน้าจอ Login Password โดย User ต้องทําการเลือก Password =246 จาก UIPickerView จากนั้นจึงเข้าสู่หน้าจอต่อไป สามารถ Reset ค่าได้จากปุ่ม RESET BUTTON Objective : นักเรียนมีความเข้าใจในเรื่อง UIViewController User Interface และ IBOutlet Action-Target Datasouce Delegate UIPickerView by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 26. iOS Basic Development Submit App Store by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 27. Course Outline 1. Introduction & Xcode 2. Objective-C & Frameworks 3. View &ViewController 4. View &ViewController (2) 5. Submit App Store Course Outline by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 28. Developing iOS Apps :App Store Add New Application ( iTunes Connect ) Upload required icon and screenshots Upload Application Binary ( IPA File ) Waiting for app review by apple ( 7 days - Few months) by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 29. หลังจากที่นักเรียนได้เรียนรู้การพื้นฐานการเขียนโปรแกรม บน iPhone และการใช้Tool ต่าง ๆ ไปเรียบร้อยแล้ว นักเรียนก็ทําการเขียนโปรแกรมได้อย่างราบรื่น ระหว่างที่ เขียน Code นั้นก็ไม่มี Error อะไร สามารถ Compile และ Run Application ได้โดยไม่มีการ Crash ของโปรแกรมและ การทํางานต่าง ๆ นั้นรวดเร็วถูกต้องตามที่ออกแบบไว้ทุก ประการ..... by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 30. หลังจากที่นักเรียนได้เรียนรู้การพื้นฐานการเขียนโปรแกรม บน iPhone และการใช้Tool ต่าง ๆ ไปเรียบร้อยแล้ว นักเรียนก็ทําการเขียนโปรแกรมได้อย่างราบรื่น ระหว่างที่ เขียน Code นั้นก็ไม่มี Error อะไร สามารถ Compile และ Run Application ได้โดยไม่มีการ Crash ของโปรแกรมและ การทํางานต่าง ๆ นั้นรวดเร็วถูกต้องตามที่ออกแบบไว้ทุก ประการ..... ใช่หรือไม่ ? by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 31. โดยปกติแล้วขั้นตอนการเขียนโปรแกรม ระหว่างที่ ทําการ Build & Run จะเป็นเช่นนี้ 1. Error ! (ไม่สามารถ ทําการ Build ได้) 2.Warning ! (ไม่ Error แต่มีการเตือน) 3. Crash ! (Build ได้แต่ Run ไม่ได้) 4.Wrong ! (Run ได้แต่ทํางานผิด) 5. Slow ! (ทํางานถูกแต่ช้า ไม่ลื่น) 6.Work ! (ทํางานได้ถูกและเร็ว) by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 33. Debugging คือโหมดการ Run Application ไปทีละขั้นเพื่อดูทํางานของ Application ในจุดที่เราสนใจว่าทํางานได้ถูกต้องตามที่เรา ต้องการหรือไม่ โดยขั้นตอนดังนี้ by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 34. Debugging - เพิ่ม-ลบ breakpoints เพื่อหยุดโปรแกรมในจุดที่เราสนใจ - ดูค่าในตัวแปรต่าง ๆ ได้โดยการเอา Mouse ไปชี้ - Run แบบ Step in ,Step Out เพื่อตรวจสอบขั้นตอนการ ทํางานของโปรแกรม - NSLog เพื่อแสดงข้อมูลต่าง ๆ บนหน้าต่าง Console by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 35. Understanding Errors by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 36. Understanding Errors บทนี้จะอธิบายความหมายของ Error ต่าง ๆ ที่มักเจอบ่อยซึ่ง จะช่วยให้เราแก้ปัญหาได้รวดเร็วขึ้น และสามารถทําการ Build โปรแกรมได้ by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 37. Understanding Errors Expected ‘;’ before ... สาเหตุ : - ลืมใส่ ; ปิดประโยค by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 38. Understanding Errors ‘Something’ Undeclared ไม่สามารถหาที่มาของ Class Something ที่เราเรียกใช้ได้ สาเหตุ : - เขียนชื่อ Class ผิด เช่น ตัวเล็ก–ใหญ่ - ไม่ได้ import file หรือ import file ผิด - ไม่ได้ทําการ import Framework , library by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 39. Understanding Errors Statically allocated instance of Objective-C class สาเหตุ : - ลืมใส่ * ให้กับ Object ที่เป็นประเภท Dynamic เช่น NSString myString ; ที่ถูกคือ NSString *myString ; by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 40. Understanding Crash Problem by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 41. Understanding Crash Problem หลังจากที่เราแก้ Error และสามารถ Run โปรแกรมได้แล้วจะ พบว่าโปรแกรมเกิดการ Crash ในระหว่างที่ทํางาน โดยบทนี้ จะอธิบายการเกิด Crash ที่มักเจอได้บ่อย by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 42. Understanding Crash Problem “EXC_BAD_ACCESS” สาเหตุ : - ทําการเรียก Object ที่ถูก release ไปแล้ว เช่น NSString *myString ; [myString release] ; // ไม่มี object แล้ว myString = @”Test” ; การแก้ไข : - Debug ทีละขั้น หรือ ใช้เครื่องมือ Instruments ตรวจหา Zombies Object by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 43. Understanding Crash Problem “SIGABRT” = SIGNAL ABORT เป็นคําสั่งให้หยุดการทํางานของโปรแกรมเนื่องจากพบ Error สาเหตุ : - ทําการเรียก Method ที่ไม่มีอยู่ หรือ เรียกผิด เช่น NSString *myString ; myString = @”Test” ; [myString releasee] ; // Method releasee นั้นไม่มีใน Class การแก้ไข : - Debug ทีละขั้น และตรวจสอบ Warning by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 44. Understanding Interface Builder Error by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 45. Understanding Interface Builder Error: บางครั้งการ Crash โปรแกรมเกิดจากการที่เราแก้ไข file XIB ใน Interface Builder ได้เช่นกัน สาเหตุ : - กําหนด Class ผิดประเภท วิธีแก้ไข : - เปิดหน้าต่าง Console แล้วดูบรรทัดล่าสุดจะบอกราย ละเอียดของ Class ที่ Error อยู่แล้วทําการแก้ไขให้ถูกต้อง by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 46. Workshop ให้นักเรียนทํา Project ของตัวเองแล้วทดลอง Debug และ แก้ไข Error ต่าง ๆ ที่เกิดขึ้น by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 47. PerformanceTool by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 48. PerformanceTool - Clang Analyzer - Instruments by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 49. Clang Analyzer เป็นเครื่องมือในการวิเคราะห์ Code ของเราก่อนทําการ Run ว่าเขียนได้มีประสิทธิภาพหรือไม่ เช่น - ตรวจสอบจุดที่น่าจะเกิด Memory Leaked ได้ - ตรวจสอบตัวแปรที่ไม่ถูกเรียกใช้ - เรียกใช้ได้จาก menu Build and Analyze by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 50. Instruments เป็นเครื่องมือในการทดสอบ Performance ขณะที่ Run โปรแกรม - ตรวจสอบจุดที่เกิด Memory Leaked - ตรวจสอบการจองหน่วยความจํา - ตรวจสอบ Zombie Object (Object ที่ตายหรือถูก Release ไปแล้วแต่มีการเรียกใช้อีก เปรียบเสมือน Zombie ที่ตายแล้วถูกเรียกปลุกขึ้นมาใหม่) by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 51. Workshop ให้นักเรียนทําการTest Performance Project ของตัวเอง ด้วยเครื่องมือ Analyzer และ Instruments by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 52. Submit AppStore - เปิดตัววันที่ 10 July 2008 - เป็นครั้งแรกและเป็นช่องทางที่ง่ายที่สุดที่จะทําให้นักพัฒนา สามารถขาย Application ให้กับคน 155 ประเทศทั่วโลก - ผู้ใช้ 400 ล้านคนที่ีมีบัตร Credit by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 53. Submit AppStore 5-March-2012 - จํานวน App รวม (iPhone/iPad/iPodTouch) คือ 550,000+ - จํานวน App บน iPad คือ 170,000 + - ยอด AppStore Download 25,000 ล้านครั้ง 12-June-2012 - ปัจจุบันจํานวน App รวม (iPhone/iPad/iPodTouch) คือ 650,000+ - จํานวน App บน iPad คือ 225,000 + - ยอด AppStore Download 30,000 ล้านครั้ง by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 54. Submit AppStore by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 55. by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 56. by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 57. by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 58. by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 59. by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 60. by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 61. by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 62. In-App Purchases (Freemium Model) by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 63. In-App Purchases (TinyTower) by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 64. In-App Purchases Order and Chaos NBA Jam by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 65. In-App Purchases (The SmurfsVillage) 8-Year-Old Girl Racks Up $1400 Bill Buying Smurfberries in Smurf'sVillage by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 66. In-App Purchases (Restrictions) by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13
  • 67. by Eakapong Kattiya www.ibluecode.com eak.k@ibluecode.com +66 086-673-2111 Saturday, June 15, 13