随笔分类 -  iOS

上一页 1 ··· 5 6 7 8 9
摘要:In App Purchase StatusesThe following are the available states that can be assigned to your in app purchase.A)Pending Developer Approval– Your in app purchase has been created but has not been tested in a sandbox environment and approved by you.B)Approved By Developer– Your in app purchase has been 阅读全文
posted @ 2014-02-24 15:51 韦韦韦 阅读(288) 评论(0) 推荐(0)
摘要:NSCalendar*calendar = [[NSCalendaralloc]initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents*comps =nil; comps = [calendarcomponents:NSYearCalendarUnit|NSMonthCalendarUnit|NSDayCalendarUnitfromDate:mydate]; NSDateComponents*adcomps = [[NSDateComponentsalloc]init]; [adcompssetYear:0]; .. 阅读全文
posted @ 2014-01-14 09:43 韦韦韦 阅读(403) 评论(0) 推荐(0)
摘要://只需如下设置imageView [picImg setContentScaleFactor:[[UIScreenmainScreen] scale]]; picImg.contentMode = UIViewContentModeScaleAspectFill; picImg.autoresizingMask = UIViewAutoresizingFlexibleWidth;//根据你的需求 picImg.clipsToBounds = YES;//切掉多余部分 阅读全文
posted @ 2014-01-10 15:32 韦韦韦 阅读(1390) 评论(0) 推荐(0)
摘要:做这些的前提是你配置好了所有的证书,如果还没先去配置证书吧。1.打开需要生成ipa的ios项目。2.在运行按钮的后面选择ios Device3.点击Product 按钮,选择第五个Archive4.点击Distribute 的按钮5.选择三个单选按钮 Export as Xcode Archive .点击next6.这时候会让你选择存放路径,和名字,随便写。7.你可以去你选择的路径找生成的文件了,注意这时候还不是ipa文件,8.右键点击生成的文件选择“显示包内容”,然后双击打开Products 文件,再继续打开进入Applications 文件中。9.把里面的文件拉出来,再拖到iTunes中, 阅读全文
posted @ 2014-01-03 10:07 韦韦韦 阅读(295) 评论(0) 推荐(0)
摘要:UIButton *aBtn=[UIButtonbuttonWithType:UIButtonTypeCustom]; [aBtn setFrame:CGRectMake(40, 100, 60, 60)]; [aBtn setBackgroundImage:[UIImageimageNamed:@"111.png"] forState:UIControlStateNormal]; //button点击事件 [aBtn addTarget:selfaction:@selector(btnShort:) forControlEvents:UIControlEventTouch 阅读全文
posted @ 2013-12-17 15:42 韦韦韦 阅读(721) 评论(0) 推荐(0)
摘要:staticNSOperationQueue* queue;- (void)viewDidLoad{ [superviewDidLoad]; queue= [[NSOperationQueuealloc]init]; NSInvocationOperation* op = [[NSInvocationOperationalloc]initWithTarget:selfselector:@selector(download)object:nil]; [queueaddOperation:op];}- (void)download { NSURL * url = [NSURLURLWit... 阅读全文
posted @ 2013-11-26 21:51 韦韦韦 阅读(188) 评论(0) 推荐(0)
摘要:-(NSString*)GetUUID{ CFUUIDRef puuid = CFUUIDCreate( nil ); CFStringRef uuidString = CFUUIDCreateString( nil, puuid ); NSString * result = (NSString *)CFBridgingRelease(CFStringCreateCopy( NULL, uuidString)); CFRelease(puuid); CFRelease(uuidString); return result;} 阅读全文
posted @ 2013-11-26 21:47 韦韦韦 阅读(213) 评论(0) 推荐(0)
摘要://组装一个字符串,把里面的网址解析出来 NSString *urlString = @"sfdshttp://www.baidu.com"; NSError *error; //http+:[^\\s]* 这是检测网址的正则表达式 NSRegularExpression *regex =... 阅读全文
posted @ 2013-11-25 10:23 韦韦韦 阅读(311) 评论(0) 推荐(0)
摘要:abel.font=[UIFontfontWithName:@"Arial-BoldItalicMT"size:24];字体名如下:Font Family: American TypewriterFont: AmericanTypewriterFont: AmericanTypewriter-BoldFont Family: AppleGothicFont: AppleGothicFont Family: ArialFont: ArialMTFont: Arial-BoldMTFont: Arial-BoldItalicMTFont: Arial-ItalicMTFont 阅读全文
posted @ 2013-10-30 10:14 韦韦韦 阅读(244) 评论(0) 推荐(0)
摘要:- (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight 这个函数是UIImage的一个实例函数,它的功能是创建一个内容可拉伸,而边角不拉伸的图片,需要两个参数,第一个是左边不拉伸区域的宽度,第二个参数是上面不拉伸的高度。根据设置的宽度和高度,将接下来的一个像素进行左右扩展和上下拉伸。注意:可拉伸的范围都是距离leftCapWidth后的1竖排像素,和距离topCapHeight后的1横排像素。参数的意义是,如果参数指定10,5。那么,图片 阅读全文
posted @ 2013-10-26 08:58 韦韦韦 阅读(265) 评论(0) 推荐(0)
摘要:设置背景:[_tabBarsetBackgroundImage:[UIImageimageNamed:@"bg_tabbar"]];设置某个Item选中的效果:_tabBar.selectionIndicatorImage=[UIImageimageNamed:@"bar_item_selected"];//设置选中效果图片设置UITabBarItem文字颜色[[UITabBarItemappearance]setTitleTextAttributes:@{UITextAttributeTextColor:[UIColorwhiteColor]}forS 阅读全文
posted @ 2013-10-25 14:26 韦韦韦 阅读(314) 评论(0) 推荐(0)
摘要:继承UISearchBar. 重载setShowCancelButton.[super xxx]; ...for (UIView *subview in self.subview) {if (subview isKindeOfClass:UIButton.class]) {cancelButton * = (UIButton*) subview;break;} 阅读全文
posted @ 2013-09-22 13:15 韦韦韦 阅读(255) 评论(0) 推荐(0)
摘要:一般我们会用此方法加载被背景图片[self.view setBackgroundColor:[UIColor colorWithPatternImage:[[UIImage alloc]initWithContentsOfFile:App_ContentFile(@"xxx", @"png")]]];但是有时候会发现内存变大的离谱,再给self.view设置背景时候可以用UIImageView:self.view = [[UIImageView alloc] init];还有一种方法也许会帮到你:self.view.layer.contents = (i 阅读全文
posted @ 2013-09-04 16:34 韦韦韦 阅读(286) 评论(0) 推荐(0)
摘要:-(UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size{ UIGraphicsBeginImageContext(size); [img drawInRect:CGRectMake(0, 0, size.width, size.height)]; UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return scaledImage;} 阅读全文
posted @ 2013-09-04 10:40 韦韦韦 阅读(627) 评论(1) 推荐(0)
摘要:for (UIView *searchBarSubview in [searchBar subviews]) {if ([searchBarSubview conformsToProtocol:@protocol(UITextInputTraits)]) {[(UITextField *)searchBarSubview setReturnKeyType:UIReturnKeyDone]; [(UITextField *)searchBarSubview setEnablesReturnKeyAutomatically:NO];}} 阅读全文
posted @ 2013-09-04 10:35 韦韦韦 阅读(314) 评论(0) 推荐(0)
摘要:1.获取音频文件路径例如:NSURL*recordedFile=[NSURLfileURLWithPath:[NSTemporaryDirectory()stringByAppendingPathComponent:[NSStringstringWithFormat:@"%.0f.%@",[NSDatetimeIntervalSinceReferenceDate]*1000.0,@"caf"]]];2.将音频文件转成NSDataNSData*soundData=[[NSDataalloc]initWithContentsOfURL:recordedFil 阅读全文
posted @ 2013-08-22 22:22 韦韦韦 阅读(438) 评论(1) 推荐(0)
摘要:dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [self.tableView reloadData]; });注意:有待于进一步考证这个用法 阅读全文
posted @ 2013-08-16 10:38 韦韦韦 阅读(366) 评论(2) 推荐(0)
摘要:// 原代码块一 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ // 原代码块二 NSURL * url = [NSURLURLWithString:@"http://www.youdao.com"]; NSError * error; NSString * data = [NSStringstringWithContentsOfURL:url encoding:NSUTF8StringEncodingerror:&error]; if (data.. 阅读全文
posted @ 2013-08-16 10:01 韦韦韦 阅读(190) 评论(0) 推荐(0)
摘要:+ (UIImage*)imageFromView:(UIView*)view{ UIGraphicsBeginImageContextWithOptions(view.bounds.size, YES, view.layer.contentsScale); [view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); retu... 阅读全文
posted @ 2013-08-16 09:56 韦韦韦 阅读(186) 评论(0) 推荐(0)

上一页 1 ··· 5 6 7 8 9