
oc
文章平均质量分 58
迷路的猪
人丑就该多读书
展开
-
iOS状态栏 白色
plist文件设置 View controller-based status bar appearance 为 NO; Status bar style 为 UIStatusBarStyleLightContent原创 2018-06-17 09:54:14 · 462 阅读 · 0 评论 -
ios webview image 适应宽高
后台返回 一段- (void)webViewDidFinishLoad:(UIWebView *)webView{}原创 2014-07-17 09:45:36 · 1530 阅读 · 0 评论 -
ios9 简单粗暴总结
1.网络plist文件修改NSAppTransportSecurityNSAllowsArbitraryLoads2.瘦身build settingsenable bitcode -->NO3.白名单plist文件修改LSApplicationQueriesSchemes wechat weixin原创 2016-01-08 10:18:28 · 413 阅读 · 0 评论 -
ios 画虚线
需要 用到 CGContextSetLineDash此函数需要四个参数:context – 这个不用多说phase - 稍后再说lengths – 指明虚线是如何交替绘制,具体看例子count – lengths数组的长度CGContextRef context =UIGraphicsGetCurrentContext(); CGContextBegi原创 2015-07-03 09:54:27 · 449 阅读 · 0 评论 -
新浪微博SDK抛出异常-[__NSDictionaryM weibosdk_WBSDKJSONString]:
不得不说 新浪微博那 SDK 做得很屎。[WeiboSDK registerApp: @"xxxxxxxx"];[__NSDictionaryM weibosdk_WBSDKJSONString] : unrecognized selector sent to instance 0x170255780官方文档说:在工程中引入静态库之后,需要在编译时添加原创 2015-07-02 10:35:35 · 629 阅读 · 0 评论 -
WeChatApiUtil EncodeBase64: 运行错误
吐槽完 微博的SDK 再来吐槽一下 微信 SDK 1.5 的大坑先列出 错误信息Undefined symbols for architecture i386: "operator delete[](void*)", referenced from: +[WeChatApiUtil EncodeBase64:] in libWeChatSDK.a(WeC原创 2015-07-02 10:42:41 · 1775 阅读 · 0 评论 -
微博SDK 分享以后无法返回
1.在info.plist文件里增加url types,在url schems里填上wbXXXX(AppKey)2.确保SDK中设置的redirect_uri与新浪微博开放平台中设置的相同(相同即可,是什么无所谓)3.确保应用的bundle id(info.plist中的)与新浪微博开放平台中(应用基本信息里)设置的相同所有配置都正确,我在第二个问题上卡了,因为不知道谁在官网上原创 2015-07-02 10:47:11 · 414 阅读 · 0 评论 -
状态栏高度改变 tabbar高度问题
一般开发的时候都会涉及到自定义tabbar,只是把原来的隐藏了然后再在原始tabbar的上面添加一层view,这个view一帮都是高度定死的,没有考虑的页面整体高度改变的时候tabbar的位置也要改变。有两点 1.接收 UIApplicationWillChangeStatusBarFrameNotification 通知来处理tabbar高度2.程序开始激活状态 调用 高度改变的方法原创 2015-01-09 09:18:52 · 973 阅读 · 0 评论 -
UITableView _endCellAnimationsWithContext section
[self.placementArrayremoveObjectAtIndex:indexPath.row]; if (self.placementArray.count == 0) { [self.tableViewdeleteSections:[NSIndexSetindexSetWithIndex:indexPath.secti原创 2014-11-18 11:38:22 · 559 阅读 · 0 评论 -
Code signing is required for product type 'Application' in SDK 'iOS 10.0'
Code signing is required for product type 'Application' in SDK 'iOS 10.0'选择自己的开发者账号原创 2016-10-23 14:19:39 · 438 阅读 · 0 评论 -
webview图片适应屏幕,图片可点击
-(void)webViewDidFinishLoad:(UIWebView *)webView{ [webView stringByEvaluatingJavaScriptFromString: @"var script = document.createElement('script');" "script.type = 'text/javascript';"原创 2016-10-25 10:06:53 · 386 阅读 · 0 评论 -
uinocde转中文UTF-8
uinocde转中文UTF-8在 NSString + additongs.m 中写下面-(NSString*) replaceUnicode{ NSString * TransformUnicodeString = self; NSString * tepStr1 = [TransformUnicodeString stringByReplacingO原创 2016-11-08 09:22:40 · 471 阅读 · 0 评论 -
iosblock
-(id)initWithType:(DDAlertType)alertType title:(NSString *)title message:(NSString *)message btnName:(NSString *)btnName finished:(void(^)())onFinishedtypedef void(^DDblock)(NSDictionary *);@p原创 2017-04-13 16:20:33 · 426 阅读 · 0 评论 -
iOS tabbar 选中未选中
-(BaseNavigationController *)createVC:(NSString *)aClassName tabName:(NSString *)tabName image:(NSString *)image selectedImage:(NSString *)selectedImage{ UIViewController * vc = [[NSClassFromStri原创 2017-10-19 17:12:49 · 1163 阅读 · 0 评论 -
iOS 虚线圆
-(void)createDashline{ CAShapeLayer * line = [CAShapeLayer layer]; CGMutablePathRef path = CGPathCreateMutable(); line.fillColor = [UIColor clearColor].CGColor; line.strokeColor = [UI原创 2017-05-08 16:55:44 · 1206 阅读 · 0 评论 -
请求头添加UTF8编码
AFHTTPSessionManager *session = [AFHTTPSessionManager manager]; session.requestSerializer = [AFHTTPRequestSerializer serializer]; session.responseSerializer = [AFHTTPResponseSerializer seriali原创 2016-11-15 16:50:44 · 17638 阅读 · 0 评论 -
XCode8屏蔽系统log 真机调试NSLog没输出
屏蔽的方法如下:Xcode8里边 Edit Scheme-> Run -> Arguments, 在Environment Variables里边添加OS_ACTIVITY_MODE = Disable原创 2016-10-23 14:15:32 · 4837 阅读 · 0 评论 -
UIWebview ScalesPageToFit 页面变小
1.webview加载表格遇到了问题,表格超出了当前的视图范围。2.我设置[_webView setScalesPageToFit:YES];3.但是自动缩小了。。。FK4.解决办法是不要[_webView setScalesPageToFit:YES];5.要计算body的宽度 NSString *bodyWidth= [webView stringByEvaluatingJav原创 2016-11-01 16:44:21 · 2655 阅读 · 0 评论 -
导航栏设置背景,去掉下面的黑线
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"luckMoney_nav_bg"] forBarMetrics:UIBarMetricsDefault]; [self.navigationController.navigationBar setShadowImage:[UI原创 2016-11-10 10:12:03 · 370 阅读 · 0 评论 -
导航栏 透明
[self.navigationController.navigationBar setTranslucent:YES]; UIColor * color = [UIColor clearColor]; CGRect rect = CGRectMake(0, 0, KEY_WINDOW.width, 64); UIGraphicsBeginImageContext(rec原创 2016-11-10 10:11:07 · 304 阅读 · 0 评论 -
颜色渐变
CAGradientLayer *gradient = [CAGradientLayer layer]; gradient.frame = rect; gradient.colors = [NSArray arrayWithObjects:(id)[UIColor blackColor].CGColor,原创 2014-10-13 09:24:41 · 471 阅读 · 0 评论 -
Unwind Segue not working in iOS 8
http://stackoverflow.com/questions/25654941/unwind-segue-not-working-in-ios-8原创 2014-10-13 18:53:06 · 704 阅读 · 0 评论 -
JsonKit 在xcode5 上报错
第一个:array->isa = _JKArrayClass;第二个:dictionary->isa = _JKDictionaryClass;解决办法:array->isa = _JKArrayClass; 改成:object_setClass(array,_JKArrayClass);dictionary->isa = _原创 2014-01-09 13:32:00 · 1818 阅读 · 0 评论 -
ios 拨打电话 三种方法
1,这种方法,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示 NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxxxxxx"]; [[UIApplication sharedApplication] openURL:[NSURL URLWithSt转载 2014-01-06 13:13:19 · 970 阅读 · 0 评论 -
自定义ios7标题栏和状态栏
看这个http://blog.youkuaiyun.com/hufengvip/article/details/17193359转载 2013-12-10 16:37:23 · 589 阅读 · 0 评论 -
Undefined symbols for architecture armv7:
Undefined symbols for architecture armv7:更新百度统计的时候遇到了这样的问题,可能有几个原因,我总结了两点一个是在Xcode Build Phase 的Link Binary With Libraries 添加对应的库另一个是这个库(我用的是百度统计)需要添加对应的framework (百度统计说添加一个AdSuppport.framewor原创 2013-12-10 16:28:55 · 3616 阅读 · 0 评论 -
同步推无需越狱可以安装正版是什么原理?
原理很简单,苹果开发者账号有一种叫做企业部署账号,$299/年,这个账号发布的App不能上App Store,原意是用来批量部署企业自己开发的App的,只能在企业内部发布、使用。 国内的PP助手之类他们搞到软件后(他们不用去买App,满大街都是破解版),去除签名,然后用他们的企业部署账号签上名,就可以用In House部署方式提供直接安装了,也叫做Over The Air部署 。 严格来说,P转载 2013-11-13 10:41:22 · 2574 阅读 · 0 评论 -
ios7 fetchedResultsController 不能获取数据问题
解决办法:NSFetchedResultsController *aFetchedResultsController ; if (isiOS7Latter()) { aFetchedResultsController = [[NSFetchedResultsControlleralloc]原创 2013-11-12 17:17:35 · 782 阅读 · 0 评论 -
How to get UITableView from UITableViewCell?
In iOS7 beta 5 UITableViewWrapperView is the superview of a UITableViewCell. AlsoUITableView is superview of a UITableViewWrapperView.So for iOS 7 the solution isUITableView *tableView =转载 2013-11-11 14:42:45 · 1075 阅读 · 0 评论 -
ios 代码裁剪图片
之前只知道超出bounds然后通过clipToBounds进行图片的裁剪,后来明白了,这个裁剪只是将超出的部分不做显示了,但是还是那个大图,所以占用内存还是大图的后来明白了,可以通过一下代码截取图片,图片大小就是rect指定的大小,内存就是小图的了 CGImageRef imageRef = self.imageView.image.CGImage;转载 2013-09-27 08:39:06 · 801 阅读 · 0 评论 -
报错:Undefined symbols for architecture i386 "_deflate"
You didn't include the libz.dylib where those functions are. Select the project node, select your target, go to the Build Phases tab, expand "Link Binaries With Libraries", add libz.dylib, and try a原创 2014-01-09 13:25:36 · 629 阅读 · 0 评论 -
UILabel 自动适应宽度
#import @interface AutoSizeLabel : UILabel@end#import "AutoSizeLabel.h"@implementation AutoSizeLabel- (id)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self)原创 2014-01-09 11:11:53 · 667 阅读 · 0 评论 -
删除 文件夹下所有的 .svn
find . -name ".svn" -exec rm -rf {} \;或者find . -name ".svn" -type d -exec rm -rf {} \;原创 2014-01-12 20:46:12 · 647 阅读 · 0 评论 -
NSArray 排序sortedArrayUsingComparator
-(IBAction)onPeriodChanged:(id)sender{ NSDictionary * data1 =@{@"value":@"0"}; NSDictionary * data2 =@{@"value":@"2.2"}; NSDictionary * data3 =@{@"value":@"2.1"}; NSDiction原创 2014-10-29 17:22:04 · 2068 阅读 · 0 评论 -
tabbar 点击 两次 默认 返回 rootVC
tabbar 点击 两次 默认 返回 rootVC在项目我 我希望ta原创 2014-11-10 13:30:17 · 618 阅读 · 0 评论 -
键盘 添加自定义按钮
- (void)keyboardDidShow:(NSNotification *)notification{ UIButton * _switchNumButton = [UIButtonbuttonWithType:UIButtonTypeCustom]; UIView * _keyboardDefaultView = [selfgetSystemKeyboar原创 2014-10-23 14:29:26 · 593 阅读 · 0 评论 -
视图的单个手指识别 exclusiveTouch
随便写几句。。恩恩UIView 的exclusiveTouch 的意思就是说UIView 会独占整个触摸事件。self.exclusiveTouch =YES; 这种情况下当前的View 是事件的第一响应者,所有手指离开之前其他的View是不会相应任何触摸事件的。这个貌似能解决 一个view 中有好多button 或者 有好多cell 同时点击时产生的问题。原创 2014-03-13 17:18:41 · 755 阅读 · 0 评论 -
BreatheLight 呼吸灯
今天无意间看到 小米手机在充电的时候 home键上的小灯 一闪一闪的 好像会呼吸,于是 联想到了在ios 视图上加上一个这个效果是不是会显得有生命力。。。呵呵呵。。随便写了几行代码#import @interface BreathLight : UIView@end#import "breathLight.h"@implementation breathLight-原创 2014-03-12 18:21:47 · 1392 阅读 · 0 评论 -
app store app 下架
找了很多方法,目前就知道三种进入 Price 界面1.时间选择到未来(到了未来app还会自己上架?)2.价格写到最高999美元(不靠谱)3.去掉所有的销售区域。(貌似这个可以)原创 2014-02-12 10:34:52 · 817 阅读 · 0 评论 -
ios7 后iTunes 不能打开评分页面
ios7后app 跳转app 评分页面 显示空白,原因是URL 改变了之前是这样写的itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=YOUR_APP_IDios7后改为itms-apps://itunes.app原创 2014-01-14 16:27:39 · 1009 阅读 · 0 评论