摘要: Reachability *connectionNetWork= [Reachability reachabilityForInternetConnection] ; int status = [connectionNetWork currentReachabilityStatus ];// 0 没有网络// 1 wifi 阅读全文
posted @ 2013-08-20 18:02 菜鸟程序猿 阅读(155) 评论(0) 推荐(0) 编辑
摘要: #import "MianViewController.h"#import @interface MianViewController (){ UIImageView *shakeFeedbackOverlay; NSTimer *rotateTimer; int timeCount;}@end@implementation MianViewController- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{ self = [super initWithN... 阅读全文
posted @ 2013-08-20 17:57 菜鸟程序猿 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 今天发现一个蛋疼的问题,使用ASIHTTPRequest Get方式请求数据时候带中文,iOS客户端不能正确进行网络请求。NSURL *url = [NSURL URLWithString:@http://unmi.cc?p1=%+&sd f&p2=中文"];ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];打印出来url为nil 还好,在网上找到了如下方法就可以解决这个问题 //NSString+URLEncoding.h#import@interface NSString (OAURLEnc 阅读全文
posted @ 2013-08-08 22:40 菜鸟程序猿 阅读(662) 评论(0) 推荐(0) 编辑
摘要: .h文件#import @interface CustomLabel : UILabel{ BOOL _isEnabled;}@property (nonatomic ) BOOL isEnabled;@end.m文件#import "CustomLabel.h"@implementation CustomLabel@synthesize isEnabled = _isEnabled;- (void)drawTextInRect:(CGRect)rect{ [super drawTextInRect:rect]; CGSize textSize = [[self te... 阅读全文
posted @ 2013-07-19 10:24 菜鸟程序猿 阅读(623) 评论(0) 推荐(0) 编辑
摘要: 下开发证书步骤1.https://developer.apple.com/cn/2.https://developer.apple.com/devcenter/ios/index.action3.Certificates, Identifiers & Profiles4.Provisioning Profiles 阅读全文
posted @ 2013-06-27 10:54 菜鸟程序猿 阅读(249) 评论(0) 推荐(0) 编辑
摘要: //跳转到应用页面NSString *str = [NSString stringWithFormat:@"http://itunes.apple.com/us/app/id%d",appid]; [[UIApplication sharedApplication] openURL:[NSURL urlWithString:str]]; //跳转到评价页面NSString *str = [NSString stringWithFormat: @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/vi 阅读全文
posted @ 2013-06-19 20:58 菜鸟程序猿 阅读(928) 评论(0) 推荐(0) 编辑
摘要: UIImage+scaleToSize.h#import <UIKit/UIKit.h>@interface UIImage (scaleToSize)/* * 功能说明:自定义图片大小 * */+ (UIImage*)OriginImage:(NSString *)imageName scaleToSize:(CGSize)size;@endUIImage+scaleToSize.m#import "UIImage+scaleToSize.h"@implementation UIImage (scaleToSize)+ (UIImage*)OriginImag 阅读全文
posted @ 2013-05-23 11:10 菜鸟程序猿 阅读(324) 评论(0) 推荐(0) 编辑
摘要: #define isIPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)#define isRetina ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScree 阅读全文
posted @ 2013-05-22 09:36 菜鸟程序猿 阅读(360) 评论(0) 推荐(0) 编辑
摘要: #import <CommonCrypto/CommonDigest.h>+ (NSString *)MD5:(NSString *)str{ if (str == nil) { return nil; } const char *cStr = [str UTF8String]; unsigned char result[CC_MD5_DIGEST_LENGTH]; CC_MD5( cStr, strlen(cStr), result ); return [NSString stringWithFormat: @"%... 阅读全文
posted @ 2013-05-22 09:23 菜鸟程序猿 阅读(168) 评论(0) 推荐(0) 编辑
摘要: // 数据源 NSArray *dataArr = [NSArray arrayWithObjects:@"a1", @"abc1", @"abc4", @"abc2", nil]; // 过滤对象// NSArray *filterArr = [NSArray arrayWithObjects:@"abc1", @"abc2", nil]; NSString *filterStr = @"abc1"; // 过滤器// NSPredicate *theP 阅读全文
posted @ 2013-05-16 14:41 菜鸟程序猿 阅读(227) 评论(0) 推荐(0) 编辑