摘要: Base64是什么, 在此就不解释了.NSData + Base64.h &NSData + Base64.m 下载在这里.用法简单,就是在使用NSData之前先将NSData + Base64.h引入, 从而可以直接使用类别中的方法.大体如下: NSString *str = @"Test"; NSLog(@"原始Obj: %@", str); NSData *data = [str dataUsingEncoding:NSUTF8StringEncoding]; NSLog(@"原始Obj转为data:%@", data) 阅读全文
posted @ 2012-07-30 19:19 GreyWolf 阅读(301) 评论(0) 推荐(0) 编辑
摘要: IOS系统框架提供的两种发送Email的方法:openURL 和 MFMailComposeViewController。借助这两个方法,我们可以轻松的在应用里加入如用户反馈这类需要发送邮件的功能。1.openURL使用openURL调用系统邮箱客户端是我们在IOS3.0以下实现发邮件功能的主要手段。我们可以通过设置url里的相关参数来指定邮件的内容,不过其缺点很明显,这样的过程会导致程序暂时退出。下面是使用openURL来发邮件的一个小例子:#pragmamark-使用系统邮件客户端发送邮件-(void)launchMailApp { NSMutableString*mailUrl=[[[N 阅读全文
posted @ 2012-07-30 17:40 GreyWolf 阅读(241) 评论(0) 推荐(0) 编辑
摘要: googlecode http://code.google.com/p/skpsmtpmessage/svn checkout http://skpsmtpmessage.googlecode.com/svn/trunk/ skpsmtpmessage-read-onlygithub:git clone https://github.com/kailoa/iphone-smtp.gitskpsmtpmessage 是由Skorpiostech, Inc.为我们带来的一个SMTP协议的开源实现,使用Objective-c 实现,iOS系统的项目可以直接调用 =]skpsmtpmessage能够实 阅读全文
posted @ 2012-07-30 17:13 GreyWolf 阅读(377) 评论(0) 推荐(0) 编辑
摘要: 寫iOS App我最怕遇到的三樣處理, 大概就是1.影音, 2.網路 3.圖片沒了這三樣還能叫App嗎? 大概是我coding功力不夠吧今天來講講圖片的處理...圖片的處理大概就分這幾樣了截圖(capture), 縮放(scale),設定大小(resize), 儲存(save)這幾樣比較好處理, 另外還有濾鏡, 擦拭等, 以後再說在這個Demo code裡, 我寫了幾個方法1.等比率縮放- (UIImage *)scaleImage:(UIImage *)imagetoScale:(float)scaleSize{UIGraphicsBeginImageContext(CGSizeMake(i 阅读全文
posted @ 2012-07-30 16:19 GreyWolf 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 这段“许靖昕”先生分享的代码将示范如何缩小 UIImage@implementationUIImage(Extras)#pragmamark-#pragmamarkScaleandcropimage-(UIImage*)imageByScalingAndCroppingForSize:(CGSize)targetSize{UIImage*sourceImage=self;UIImage*newImage=nil;CGSizeimageSize=sourceImage.size;CGFloatwidth=imageSize.width;CGFloatheight=imageSize.height 阅读全文
posted @ 2012-07-30 15:50 GreyWolf 阅读(126) 评论(0) 推荐(0) 编辑
摘要: + (void)alert:(NSString *)msg{ UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:msg message:@"" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] autorelease]; [alertView showWithBackground];}+ (void) makeCall:(NSString *)phoneNumber{ if ([DeviceDetect 阅读全文
posted @ 2012-07-30 15:11 GreyWolf 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 导入MessageUI.framework.h文件中#import<MessageUI/MessageUI.h>#import<MessageUI/MFMailComposeViewController.h>实现MFMailComposeViewControllerDelegate,MFMessageComposeViewControllerDelegate.m文件//邮件-(void)showMailPicker { ClassmailClass = (NSClassFromString(@"MFMailComposeViewController" 阅读全文
posted @ 2012-07-30 14:47 GreyWolf 阅读(307) 评论(0) 推荐(0) 编辑
摘要: 邮件发送功能是由MessageUI Framework提供的,这个框架是iPhone sdk中最简单的框。由一个类、一个视图控制器,一个protocol组成。一、创建视图控制器:MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init]; mc.mailComposeDelegate = self; 二、设置邮件主题: [mc setSubject:@"Hello, World!"];三、设置收件人,收件人有三种:1、设置主收件人[mc setToRecipients:[NSArr 阅读全文
posted @ 2012-07-30 14:40 GreyWolf 阅读(169) 评论(0) 推荐(0) 编辑