- 博客(14)
- 资源 (1)
- 收藏
- 关注
原创 UIImage 切圆
CAShapeLayer可以制作出任意的几何图形,把它作为UIImageView的遮罩,达到把图片做成圆形效果。利用CAShapeLayer可以制作出任意的几何图形,把它作为UIImageView的遮罩,达到把图片做成圆形效果。 //创建个人主页头部的用户头像 self.userHead = [[UIImageView alloc]initWithFram
2015-08-07 13:48:11
440
转载 git 使用
本文翻译自Understanding Git Source Control in Xcode (译者myShire)欢迎您加入我们的翻译小组。 在应用程序开发过程中,很重要的一部分工作就是如何进行源码的版本控制。当代码出现问题时,我们就需要将代码恢复到原先正常的版本。如果是多个人共同开发一个项目,那么代码的控制就会非常复杂。幸运的是,开发者不需要自己控制这些,因为有专门的软件来负责
2015-03-13 14:18:02
437
原创 ios 真实随机数
srand((unsigned)time(0));//关键语句 CGFloat red = (CGFloat)(rand()%255); CGFloat green = (CGFloat)(rand()%255); CGFloat blue = (CGFloat)(rand()%255);
2015-03-13 13:36:59
436
原创 ios 判断一个nsstring 是否包含另一个 nsstring
NSString *str1 = @"hello kugou"; NSString *str2 = @"hello"; if ([str1rangeOfString:str2].location != NSNotFound) { NSLog(@"str1 iscontain str2"); } else {
2015-03-12 14:50:27
510
原创 消息推送,客户端需要调用的方法
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{ NSString *token = [[deviceTokendescription] stringByTrimmingCharacters
2015-03-10 18:04:00
378
原创 ios 获取当前屏幕快照
- (UIImage *)capture{ UIGraphicsBeginImageContextWithOptions(self.view.bounds.size,self.view.opaque,0.0); [self.view.layerrenderInContext:UIGraphicsGetCurrentContext()];
2015-03-05 16:37:30
826
原创 播放MP3音频和gif动画的一个小模块
//// GIFUseMode.m// WebView//// Created by 周三 on 15-3-3.// Copyright (c) 2015年 pluto. All rights reserved.//#import "GIFUseMode.h"#import @implementation GIFUseMode
2015-03-05 11:20:06
1320
转载 [iOS]如何向 appstore 查询已发布 APP 的信息?
如果我们需要实现版本的 app 自动更新,那么我们需要获取当前运行程序的版本信息和 appstore 里发布的最新版本信息。当前运行程序的版本信息,可以在 mainBundle 里面获取:[cpp] view plaincopyNSDictionary *infoDict = [[NSBundle mainBundle] in
2015-03-04 17:44:52
615
原创 IOS开发 如果图片太大的缩小算法,通用多种情况
- (CGSize)getSizeWithHeight:(CGFloat)height width:(CGFloat)width{ CGSize size = {0,0}; CGFloat fHeight = [UIScreenmainScreen].bounds.size.height; CGFloat fWidth = [UIScreenmainScr
2015-03-03 11:33:02
551
原创 ios 打印出所有的字体
NSMutableArray *fonts = [[NSMutableArrayalloc] init]; NSArray *family = [UIFontfamilyNames]; for (NSString *familyNamein family) { // NSLog(@"font family name = %@", fa
2015-01-04 15:37:55
719
原创 查看项目代码总行数
打开终端cd 你的项目复制下行命令回车就行find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" -or -name "*.h" -or -name "*.rss" ")" -print | xargs wc -l
2014-12-25 13:34:58
2176
原创 Label适应内容,改变高度
_commentLabel.text = commentLabelString;//这句要在算高度前 _commentLabel.font = [UIFontfontWithName:@"MicrosoftYaHei"size:16.0]; _commentLabel.numberOfLines =0;//这里设置为0表示,任意行数 _commentLab
2014-12-24 09:37:57
529
原创 模拟电子表的功能
- (void)viewDidLoad{ [superviewDidLoad]; _timeLabel.textColor = [UIColorredColor]; _timeLabel.font = [UIFontsystemFontOfSize:13]; _timeLabel.backgroundColor = [UIColorcol
2014-12-23 11:39:17
479
原创 在ios应用中,获取uuid,并删除uuid中的-符号
CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault); NSString *uuid = (NSString *)CFBridgingRelease(CFUUIDCreateString (kCFAllocatorDefault,uuidRef)); //生成uuid代码如上 uuid = [uuid string
2014-12-23 09:42:09
958
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人