Daily Archives: กุมภาพันธ์ 19, 2011

iPhone: Dialing number, opening Email & SMS applications


Dialing number, opening Email & SMS applications

http://adeem.me/blog/2009/05/27/iphone-sdk-tips-dialling-number-opening-email-sms-applications/

Content

  1. Dial Number
    • [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@”tel://123123″]];
  2. Open Email application
    • [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@”mailto:emailAdress?subject=testMail&body=its test mail.”]];
  3. Open SMS application
    • [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@”sms:111″]];

iPhone: How to check if it contains partial value


How to check if it contains partial value

use NSRange check [rangeOfString:(NSString*)string] and compare that range instance with NSNotFound

Example

NSString *searchFor = @"home";
NSString *word = @"Welcome to my home: adaydesign's blog";
NSRange range = [word rangeOfString:searchFor];
if (range.location != NSNotFound){
     NSLog (@"Result '%@' found in '%@'.", searchFor, word);
}else{
     NSLog (@"Result '%@' not found in '%@'.", searchFor, word);
}

Read the rest of this entry

iPhone: Display a loading icon while a network resource is being downloaded


Display a loading icon while a network resource is being downloaded

http://stackoverflow.com/questions/212215/display-a-loading-icon-while-a-network-resource-is-being-downloaded

สำหรับการโหลดข้อมูลเยอะๆ เราต้องมี user interface เพื่อบอกผู้ใช้ว่า “ขณะนี้คุณต้องรอก่อนนะ” และ UI ตัวนั้นชื่อว่า UIActivityIndicator เรามาลองทำดูนะครับว่ามันใช้ยังไง

Read the rest of this entry

%d bloggers like this: