- 博客(71)
- 资源 (13)
- 收藏
- 关注
原创 关联查询
select* from ATPushModelFromUserTable ainner join ATPushModelTable bwhere b.user=a.rowid
2015-03-05 13:34:08
606
原创 计算文本宽高
CGSize getTextSize(UIFont *font,NSString *text,CGFloat maxWidth){ if (iOS_VERSION_NOT_LESS_THAN_7) { CGSize textSize = [text boundingRectWithSize:CGSizeMake(maxWidth,MAXFLOAT)
2014-09-01 17:37:47
855
原创 iOS判断是否为中文, nsstring的类方法
-(BOOL)isChinese{ NSString *match=@"(^[\u4e00-\u9fa5]+$)"; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF matches %@", match]; return [predicate evaluateWithOb
2014-08-25 13:42:39
643
原创 iOS 相册图片,相机图片被旋转问题 uiimage orientation
把- (UIImage *)fixOrientation:(UIImage *)aImage { // No-op if the orientation is already correct if (aImage.imageOrientation == UIImageOrientationUp) return aImage; // We
2014-08-05 15:28:53
1108
原创 iOS 深度拷贝
NSCopying>-(instancetype)copyWithZone:(NSZone *)zone{ PhoneAddressBooKModel *copied = [PhoneAddressBooKModelnew]; copied.nodeId =self.nodeId; return copied;}
2014-07-29 18:27:02
511
原创 iOS string 直接长度计算
-(int)convertToInt:(NSString *)strtemp { int strlength = 0; char* p = (char*)[strtemp cStringUsingEncoding:NSUnicodeStringEncoding]; for (int i=0 ; i if (*p) { p++
2014-07-24 16:22:54
697
原创 iOS 画虚线 cgcontext
- (id)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self) { self.backgroundColor = [UIColorclearColor]; } return self;}-(v
2014-07-23 09:51:07
1045
原创 CAShapeLayer 局部区域暗色处理 iOS图片裁剪处理
- (void)viewDidLoad{ [superviewDidLoad]; UIImage *image = [UIImage imageNamed:@"mask"]; // CALayer *maskingLayer = [CALayer layer];// maskingLayer.frame
2014-07-22 20:58:42
1142
原创 全局改变 方法 appearance
[[UINavigationBarappearance] setBarTintColor:CAREMAINCOLOR];
2014-07-17 17:16:02
557
原创 修改图片大小
float minW = image.size.width/beis; float minH = image.size.height/beis; CGRect rectMAX = CGRectMake(0,0, minW, minH);; UIGraphicsBeginImageContext(r
2014-06-26 17:50:29
537
转载 Choose a destination with a supported architecture in order to run on this device.
通常出现这个问题的原因是以前的老项目在新版本的xcode中打开时会出现为这个问题。郁闷了一段时间, 在网上也没有找到合适的解决方案, 后来发现其实是这个提示过于误导。大部分人看到这个提示,立马会想到可能是architecture设置成不对,但不管怎么去修改,这个错误还是会存在。 其实只要把编译器改成现在的LLVM即可。 修改位置Project->Build Sett
2014-04-19 09:55:17
512
原创 CGRectContainsPoint.......等用法
判断给定的点是否被一个CGRect包含,可以用CGRectContainsPoint函数 BOOL contains = CGRectContainsPoint(CGRect rect, CGPoint point);判断一个CGRect是否包含再另一个CGRect里面,常用与测试给定的对象之间是否又重叠 BOOL contains = CGRectCo
2014-03-27 15:42:09
2252
原创 iOS UIScrollview 更具力度翻页
*targetContentOffset =CGPointMake(((int)(((float)targetContentOffset->x)/ScrollWidth)*ScrollWidth), targetContentOffset->y);
2014-03-20 20:41:18
1147
原创 iOS UITextView 限制输入字数
#pragma mark textField代理- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{ if ([text isEqualToString:@"\n"]) { retu
2014-03-19 16:14:01
1101
原创 githut iOS 开源项目
将Github上600多个iOS开源项目进行分类并且有相应介绍,小伙伴们快来看呀地址:http://github.ibireme.com/github/list/ios/
2014-03-15 14:04:19
778
原创 scrollview 无限循环
放在didscrollview里面 //无限循环.... float targetX = _scrollView.contentOffset.x; int numCount = [self.collectionViewnumberOfItemsInSection:0]; float ITEM_WIDTH = _scrollView.frame.
2014-03-13 10:03:13
751
原创 GCD 异步加载
dispatch_queue_t queue =dispatch_get_global_queue(0,0); dispatch_async(queue, ^{ UIImage *gameImg =[UIImageimageNamed:data.event_gameImg]; disp
2014-03-07 19:35:53
700
原创 html css 图片缩放等居中显示代码
$(document).ready(function () { var maxWidth = document.documentElement.clientWidth; // 图片最大宽度 var maxHeight = document.documentElement.clientHeight; // 图片最大高度
2014-01-09 14:20:44
2963
原创 iOS 设备听筒距离监测
[[UIDevicecurrentDevice] setProximityMonitoringEnabled:YES]; NSLog(@"开启距离监听");} [[UIDevicecurrentDevice] setProximityMonitoringEnabled:NO]; NSLog(@"关闭距离监听");
2013-12-27 09:38:48
659
原创 调试ios内存问题
Product ->sc->ma sc->endic -》 NakkocStackLogging 中的E V YES NSZombieEnabled YES 在运行
2013-12-27 09:23:41
501
原创 navigationController上item控件颜色
self.navigationController.navigationBar.tintColor=[UIColor whiteColor];
2013-12-14 10:05:03
532
原创 应用webview 获取网页事件
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{ NSLog(@"%@",request.URL.relativeString );
2013-12-14 09:57:20
670
原创 pm文件推送
把XXX.p12放在桌面 先cd desktop然后openssl pkcs12 -in cer.p12 -out cer.pem -nodes然后会提示 输入密码值得注意的是:输入的密码他一个文字也不会显示 只等我们输入完 他会验证是否成功 没显示并不是卡住
2013-12-12 16:20:33
620
原创 iOS 7 的变化,UITabBarItem
if( ([[[UIDevicecurrentDevice] systemVersion]doubleValue]>=7.0)) { tabBarItemImage = [tabBarItemImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; tabBarItemSelete
2013-12-11 09:12:34
2043
原创 tabBarController 的隐藏问题
- (void)hideTabbar:(BOOL)hidden { // CGRect windowFrame = iPhone5 ? CGRectMake(0.0f, 0.0f, 320.0f, 568.0f) : CGRectMake(0.0f, 0.0f, 320.0f, 480.0f); CGRect windowFrame=[[UIScreenma
2013-12-05 11:53:40
800
原创 uiimageview 圆角
UIImageView *view=[[UIImageViewalloc]initWithFrame:CGRectMake(10,0, 300,130)]; [view.layersetMasksToBounds:YES]; view.layer.cornerRadius=4; view.clipsToBounds=YES;
2013-12-05 11:26:47
810
原创 UIViewContentModeScaleAspectFill图片放大
UIImageView *img=[dicobjectForKey:@"img"];// img.contentMode=UIViewContentModeScaleAspectFit; img.contentMode=UIViewContentModeScaleAspectFill; img.clipsTo
2013-12-02 14:29:34
1739
原创 iOS 播放本地视频
NSURL * videoURL = [NSURLfileURLWithPath:_PlayURL]; PlayLoadMovieView *load=[[PlayLoadMovieViewalloc]initWithContentURL:videoURL]; [selfpresentModalViewController:lo
2013-11-06 18:59:09
923
原创 ios 修改UITabBarItem字体颜色,正常与选中状态
言归正传,设置UITabBarItem使用自己设计的图片,其中UITabBarItem中有一个方法[plain] view plaincopy- (void)setFinishedSelectedImage:(UIImage *)selectedImage withFinishedUnselectedImage:(UIImage *)unse
2013-11-06 16:51:55
8729
原创 ios版本监测与更新
如果我们要检测app版本的更新,那么我们必须获取当前运行app版本的版本信息和appstore 上发布的最新版本的信息。当前运行版本信息可以通过info.plist文件中的bundle version中获取: NSDictionary *infoDic = [[NSBundlemainBundle] infoDictionary];
2013-10-29 18:03:59
793
原创 iOS图片曲线,抛物线动效
CGMutablePathRef path =CGPathCreateMutable(); CGPoint p1 = CGPointMake(20,100); CGPoint p3 = CGPointMake(285 ,385*iPhone5Ratr); CGPathMoveToPoint(path,NULL, p1.x,
2013-10-29 14:44:12
3623
原创 百度云推送客户端配置IOs
先配置好百度开发文档中的东西,一下实现一个在回调中获取连接,跳转。- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{ self.userInfo = userInfo; NSString *alert
2013-10-29 12:04:10
1826
原创 iOS 归档方法UserDefaults
@property (nonatomic,strong)NSUserDefaults * mUserDefaults;- (id) init { self = [superinit]; if (self) { _mUserDefaults = [NSUserDefaultsstandardUserDefaults];
2013-10-26 15:37:17
596
原创 ios登陆过期的判断
#pragma mask 更新过期状态- (void)applicationDidBecomeActive:(UIApplication *)application{ NSLog(@"applicationDidBecomeActiveapplicationDidBecomeActiveapplicationDidBecomeActive"); //运行
2013-10-26 15:34:49
1815
原创 mutating method sent to immutable object NSUserDefaults出错
在数据归档的时候刚开始用的事这样的代码[app preferenceWithName:KmyCarproductIDs] 这个事归档中得到数据的方法。返回的事一个数组 NSMutableArray *MuArrs=[[NSMutableArrayalloc]init]; MuArrs =[apppreferenceWithName:KmyCarpr
2013-10-25 09:35:40
673
原创 ios UIApplication 在本地消息的推送上的应用
那么UIApplicationMain函数到底做了哪些事情呢?这个函数主要负责三件 事情: 1)从给定的类名初始化应用程序对象,也就是初始化UIApplication或者子类对象的一个实例,如果你在这里给定的是nil,那么系统会默认UIApplication类,也就主要是这个类来控制以及协调应用程序的运行。在后续的工作中,你可以用静态方法sharedApplication
2013-10-14 17:34:02
949
原创 ios uiview的动画效果
iphone中存在很多好看的动画效果,用于页面的切换等。其中某些是apple私有的,据说私有的无法通过apple的审批。最近工作中刚好用到过其中的某些动画,所以在网上搜了下资料,了解了下这些动画。这里就自己的理解做一下总结,如有错误或遗漏,尽请谅解。 1、UIView 动画官方API中,使用UIView可以设置5个动画效果,分别为:UIVie
2013-10-13 22:10:59
974
第三方类,tableview刷新,scrollview,HUD,图片阴影
2013-09-15
ios播放器tableview录音
2013-08-05
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人