iOS记录
WSxiaotao
这个作者很懒,什么都没留下…
展开
-
struct 转对象(NSValue)
1.struct aStruct{ int a; int b;};typedef struct aStruct aStruct;2.aStruct struct; struct.a = 0; struct.b = 0;NSValue *anObj = [NSValue value:&struct withObjCType:@encode(aStruct)];NSArr原创 2014-07-17 11:58:03 · 1936 阅读 · 0 评论 -
view 在父view 拖动不过边界(UIPanGestureRecognizer)
- (void)viewDidPan:(UIPanGestureRecognizer*)sender{ CGPoint p = [sender translationInView:self.superview]; if(sender.state== UIGestureRecognizerStateBegan){ _initial原创 2015-08-22 13:21:03 · 1975 阅读 · 0 评论 -
群发短信 发短信(带图片)
/** * 群发短信 * * @paramshareImage */- (void)sendSMS:(UIImage*)shareImage withMoblieList:(NSArray*)mobileList{ MFMessageComposeViewController*picker = [[MFMessageComposeVi原创 2015-08-22 13:23:18 · 2276 阅读 · 0 评论 -
openssl rsa.h file not found
Header Search Paths 问题解决方法:项目里边找到文件夹,直接拖到Header Search Paths 会生成一个路径然后去掉””就可以了原创 2015-08-22 13:16:21 · 1061 阅读 · 0 评论 -
一个矩形是否包含一个点
1.一个矩形是否包含一个点CGRectContainsPoint(, )2.一个矩形是否包含另一个矩形CGRectContainsRect(, )原创 2015-08-22 13:22:06 · 1020 阅读 · 0 评论 -
透明导航条
/** * 初始化透明Navbar */- (void)initlizerNavBarStype{ [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault]; self.navigationController.navigationBar.translucent =原创 2016-01-23 15:49:59 · 548 阅读 · 0 评论 -
cocoapods 安装
cocoapods安装1>.//删除官方的ruby环境gem sources --remove https://rubygems.org/2>. //等有反应之后再敲入以下命令gem sources -a http://ruby.taobao.org/3>.为了验证你的Ruby镜像是并且仅是taobaogem sources -l显示为ruby.原创 2016-04-05 18:26:15 · 363 阅读 · 0 评论 -
GPUImage 正片叠底效果
GPUImagePicture *stillImageSource1 = [[GPUImagePicturealloc] initWithImage:_overImage]; GPUImagePicture *stillImageSource2 = [[GPUImagePicturealloc] initWithImage:_contentImage];原创 2014-07-27 17:30:20 · 2662 阅读 · 0 评论 -
关于iOS强制横屏
关于iOS强制横屏所有都是竖屏只有一个是横屏的情况首先要添加支持转屏在RootViewController加上下面代码- (BOOL)shouldAutorotate{//这个是控制是否可以转屏 return NO;}- (NSUInteger)supportedInterfaceOrientations {//这个是支持哪些方向 return UI原创 2014-06-10 20:53:45 · 1343 阅读 · 0 评论 -
TTTAttributedLabel 使用
https://github.com/mattt/TTTAttributedLabel- (TTTAttributedLabel *)initlizerLinkLabel:(NSString *)content WithUserName:(NSString *)userName原创 2014-09-26 09:48:17 · 3472 阅读 · 0 评论 -
计算两个经纬度之前的距离
方法一- (double)caluteDistance:(double)lat1 :(double)lat2 :(double)lon1 :(double)lon2{ CLLocation *location1 = [[CLLocation alloc] initWithLatitude:lat1 longitude:lon1]; CLLocation *location2转载 2014-09-26 09:44:08 · 798 阅读 · 0 评论 -
几个键盘通知
几个键盘通知 每次都要找 还是记录一下吧[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:)转载 2014-06-11 14:27:10 · 583 阅读 · 0 评论 -
swift学习
Objective-C和Swift混合编程开发(一)http://blog.diveinedu.net/objective-c-swift-framework-dev/Swift与Objective-C API交互(一)http://blog.diveinedu.net/swift_objective_c_api_interactive_1/Swift与Objective-原创 2014-06-06 11:20:28 · 1211 阅读 · 0 评论 -
makeObjectsPerformSelector 方法的用法
nsarray 类定义的方法1. makeObjectsPerformSelector:@select(aMethod)简介:让数组中的每个元素 都调用 aMethod 2. makeObjectsPerformSelector:@select(aMethod) withObject:oneObject简介:让数组中原创 2014-07-29 11:01:13 · 1275 阅读 · 0 评论 -
button 修改 title 和 image偏移量
实现button hh[button setImageEdgeInsets:UIEdgeInsetsMake(, , , )];同时还可以设置文字的偏移量:[button setTitleEdgeInsets:UIEdgeInsetsMake(, , , )];原创 2014-07-30 10:25:28 · 989 阅读 · 0 评论 -
.弧度转角度/角度转弧度
iphone里面角度和弧度经常要转换,比如旋转一个图片,你要用到CGAffineTransformMakeRotation,他就需要一个弧度值做完输入。下面是两个宏,来实现互转1.弧度转角度#define RADIANS_TO_DEGREES(radians) ((radians) * (180.0 / M_PI))NSLog(@"Output radians as d转载 2014-08-06 23:48:12 · 2072 阅读 · 0 评论 -
UIView+Border(添加任意一边)
CALayer *bottomBorder = [CALayer layer]; bottomBorder.frame = CGRectMake(0.0f, 0.0f, 1.0f, btnValite.frame.size.height); bottomBorder.backgroundColor = [UIColor colorWithWhite:0.8f原创 2014-07-14 14:08:21 · 7764 阅读 · 0 评论 -
Uibutton 左对齐
Uibutton *button = [UIButton buttonWithType:UIButtonTypeCustom];button = CGRectMake(10, 0, 60, selectView.frame.size.height);[button setTitle:self.energyParamName forState:UIControlStateNormal];原创 2014-06-23 10:43:23 · 697 阅读 · 0 评论 -
截屏代码 地图
CGImageRef UIGetScreenImage();- (UIImage *)captureScreenImage{ @autoreleasepool { CGImageRef cgImage = UIGetScreenImage(); void *imageBytes = NULL; if (cgImage == NULL) {转载 2014-08-20 20:10:58 · 563 阅读 · 0 评论 -
防止屏幕暗掉锁屏
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];转载 2014-03-26 15:35:48 · 816 阅读 · 0 评论 -
Font 根据路径返回字体(TTF)
-(UIFont*)customFontWithPath:(NSString*)path size:(CGFloat)size{ NSURL *fontUrl = [NSURL fileURLWithPath:path]; CGDataProviderRef fontDataProvider = CGDataProviderCreateWithURL((__br转载 2015-08-22 13:18:58 · 1967 阅读 · 0 评论