2011年12月1日 | 分类: iOS / Objective-C, 应用技巧 | 标签: , , ,

我遇到了一个问题,就是用户通过邮箱分享一些东西的时候如果没有设置邮件账号则应用会死掉。昨天看到网易新闻的分享功能,如果通过邮箱而且用户没有设置自己的邮箱则程序会跳到添加邮件账号的页面。于是开始了漫长的搜索之路。。。

很幸运的是就在刚才被我搜到了,下面和大家分享一下: 阅读全文…

Share
2011年10月20日 | 分类: iOS / Objective-C, Mac, 应用技巧 | 标签:

今天为了找应用app store的应用更新连接花费了我好久的时间,现在与大家分享一下:
阅读全文…

Share
2011年10月12日 | 分类: iOS / Objective-C, Mac, 应用技巧 | 标签:

You can make a UIImage category and use it wherever you need. Based on HitScans response and comments bellow it.

@implementation UIImage (Crop)
 
- (UIImage *)crop:(CGRect)rect {
 
    CGFloat scale = [[UIScreen mainScreen] scale];
 
    if (scale>1.0) {        
        rect = CGRectMake(rect.origin.x*scale , rect.origin.y*scale, rect.size.width*scale, rect.size.height*scale);        
    }
 
    CGImageRef imageRef = CGImageCreateWithImageInRect([self CGImage], rect);
    UIImage *result = [UIImage imageWithCGImage:imageRef];
    CGImageRelease(imageRef);
    return result;
}
 
@end

You can use it this way:

UIImage *imageToCrop = <yourimagetocrop>;;
CGRect cropRect = <areayouwanttocrop>;   
 
UIImage *croppedImage = [imageToCrop crop:cropRect];</areayouwanttocrop></yourimagetocrop>

参考网址:http://stackoverflow.com/questions/158914/cropping-a-uiimage

Share
2011年10月10日 | 分类: iOS / Objective-C, Mac, 应用技巧 | 标签:

Mac CAF/AIF/MP3 sound file FAQ: How do I convert a CAF file to AIF format, MP3 format, or any other sound file format on Mac OS X, for free?

Convert CAF to AIF, MP3, WAV, for free – solution

While writing my Mac “Hide Your Desktop” application, I can’t work with certain sound file formats yet, so I’ve been digging around trying to figure out how to convert Apple’s “CAF” file format into a format I can deal with, and I really need files to be in an AIF, MP3, WAV, or AU format.

Last night I found a cool Mac OS X command-line utility named “afconvert” that lets you convert sound files from one format to another, for free. So I dug into it, and eventually created a shell script that lets me convert all my CAF sound files into AIF sound files. A slightly modified version of the same script will allow you to convert CAF or AIF sound files to MP3, WAV, and other sound file formats. 阅读全文…

Share
2011年8月12日 | 分类: Mac | 标签:

chflags nohidden|hidden /path/to/hide|show

Share
2011年8月9日 | 分类: 未分类 | 标签:

选择项目->Build Phases->Compile Sources,,给需要禁止arc的文件添加-fno-objc-arc(双击该文件)编译标志(Compiler Flags)。

Share
2011年8月9日 | 分类: iOS / Objective-C | 标签:
  • CFNetwork.framework
  • libz.dylib
  • MobileCoreServices.framework
  • SystemConfiguration.framework
Share
2011年3月22日 | 分类: Mac | 标签:

Mac OS X 10.6.7更新更新信息

Mac OS X 10.6.7更新中

Share
2011年1月13日 | 分类: 杂谈 | 标签:
月光光歌
(1936年电影《迷途的羔羊》主题曲)
词:蔡楚生 曲:任光 唱:陈娟娟
月光光,照村庄,村庄破落炊无粮,租税重重稻麦荒。
月圆圆,照篱边,篱边狗吠不能眠,饥寒交迫泪涟涟。
月朗朗,照池塘,池塘水干种田难,他乡流落哭道旁。
月亮亮,照他乡,他乡儿郎望断肠,何时归去插新秧。
月依依,照河堤,河堤水决如山移,家家冲散死别离。
月黯黯,照荒场,荒场尸骨白如霜,又听战鼓起四方。
月凉凉,照羔羊,羔羊迷途受灾殃,天涯何处觅爹娘。
月明明,照天心,天心不知儿飘零,风吹雨打任欺淩。
月微微,照海水,海水奔流永不回,苦儿无家不得归。
月凄凄,照破衣,破衣单薄碎离离,冻死路旁无人理。
月茫茫,照高房,高房欢笑如颠狂,苦儿饥饿正彷徨。
月惨惨,照海滩,海滩无人夜漫漫,苦儿血泪已流干。

王 老 五
——影片《王老五》插曲——
(任光作曲,安娥作词) 阅读全文…
Share
2011年1月7日 | 分类: 杂谈 | 标签:

作者:金满楼

在笔者的印象中,作为演员的姜文一向很man,而作为导演的他也一贯很man,正如其新作《让子弹飞》,不出所料,又是一部让女人走开的电影——女演员能被人记住的大概只有那两只跃然而出的小白兔)。

虽然电影的场景设定在北洋时期的西南地区,但从风格上来说,《让子弹飞》是一部典型的中国西部片。总体评价,《让子弹飞》是一部成功的商业片,演员一线,段子一流,台词风趣,有流行的潜力;另外就是,电影节奏明快,现代感强,精神气足,鸡血味浓。

当然,在革命史观中,“打鸡血”并不是个坏词,譬如去年的《十月围城》和这次的《让子弹飞》,实则是同一类型,前者说的是为什么要革命,后者说的则是如何革命,归根结底,反抗暴政非革命不行,而革命又非暴力不行。 阅读全文…

Share