Sunday Oct 25, 2009

How to invoke defaut email function in your application? You can do it in this way after SDK 3.0:

iPhone Tutorial - In-App Email

In case you are still work for 2.x version, you have to use openURL to send email:

Using openURL To Send Email From You App

For SMS function, there don't have a official SDK openned.  One possible way is using openURL function as same way for email:

sms:[target phone number] URL to open the SMS application.

But there are no indications on how to prefill a SMS body with text. Also, there have two other private ways to do it but it's illegal and couldn't upload to store:

 One is using 'AT' command, another way is using private framework for SMS.

Could you share it to me if you know other way can do it?

Tuesday Sep 08, 2009

As store is already open to many countries in world, many developers start to i18n/l10n their applications to make their application can sell to customer all over the world.  There have a great article talking about iphone application i18n/l10n(Seemed you couldn't acces those links from China mainland):  

All things work!

  • Locale identifier for Chinese
Usually, we use 'zh_CN' or 'zh_TW' as locale identifier for Simplified Chinese and Traditional Chinese. But we need use 'zh-hans' or 'zh-hant' for Simplified Chinese and Traditional Chinese on iphone. Please keep it in mind if you try to l10ned your application to Chinese.

Thursday Aug 27, 2009

NSString 是 Object C 中常用的类。在这里,我搜集整理一些关于 NSString 的操作供参考:

  • 添加 '@' 在字符串前变成 NSString

NSString *t = @"test"

  • 连接 

连接有三种方法:

NSString* string1; NSString* string2;

1. NString* compose = [NSString initWithFormat:@"%@,%@", string1, string2 ];

2. NString* compose = [string1 stringByAppendingString:string2];

3 . NString* compose = [string stringByAppendingFormat:@"%@,%@",string1, string2];

其中 format 的格式为:

'%@'   是格式化 NSString 类型

%d, %D, %i 是格式化  32位有符号整数 (int)

具体见参考手册

  • 转换
int 到 NSString:   [NSString stringWithFormat:@"%d", myInt];

NSInteger 到 NSString: [NSString  stringWithFormat:@"%d", [myNSInt intValue]];


This blog copyright 2009 by leonfan