自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(56)
  • 收藏
  • 关注

原创 iOS-清除缓存

- ( void )clearFile{    NSString * cachPath = [NSSearchPathForDirectoriesInDomains (NSCachesDirectory , NSUserDomainMask , YES )firstObject ];    NSArray * files = [[NSFileManage

2017-02-09 18:51:44 468

原创 iOS-替换系统backBarButtonItem的返回二字

UIBarButtonItem *backItem = [[UIBarButtonItem alloc] init];    backItem.title = @"这就换掉了?";    self.navigationItem.backBarButtonItem = backItem;

2017-02-09 17:17:59 910

原创 iOS-文字转语音

AVSpeechSynthesisVoice:用来配置发音,支持的发音非常多.个人感觉台湾发音最好听~通过调用[AVSpeechSynthesisVoicespeechVoices]类方法可用看到支持的发音种类;AVSpeechUtterance:这个类就是用来将字符串合成为语音对象提供给AVSpeechSynthesizer来播放,这个类还有一些实例方法用来控制语速,音调

2016-11-08 17:55:44 724

原创 iOS-代码块在程序中只执行一次

staticdispatch_once_t disOnce;  dispatch_once(&disOnce, ^ {  //这里写只操作一次的代码  });

2016-11-08 13:30:58 3309

原创 iOS-手绘点

手绘点UIBezierPath *path = [UIBezierPath bezierPath];        CGFloat width = 150.f;    CGFloat height = self.tableView.height;    CGFloat x = (self.width - width) / 2;    CGFloat y = 64.5

2016-10-18 17:46:57 507

原创 iOS-选择生日,初始化日期选择器

#pragma mark — 选择生日- (void)editBrithday {    UIAlertView * _brithdayAlert = [UIAlertView new];    _brithdayAlert.title = @"编辑生日";    [_brithdayAlert addButtonWithTitle: @"取消"];    [_brithday

2016-10-18 17:46:23 767

原创 iOS-上传 包的时候 提示 Redundant binary upload

CFBundleVersion: 代表build number,必须每个包不同CFBundleShortVersionString: 发布版本号需要:general->Version 改变一下版本号,重新打包上传即可。

2016-07-18 11:30:08 703

原创 iOS-UIImagePickerController 内存警告研究

在iOS开发具有拍照功能的APP的时候会出现内存警告黑屏的问题,因此我们判断当self.presentedViewControlle是UIImagePickerController 类型时,不做内存警告处理。这样就可以避免这样的问题。- (void)didReceiveMemoryWarning{ [super didReceiveMemoryWarning];

2016-04-11 15:19:26 2294

转载 新浪分享 Insufficient app permissions!

http://www.mamicode.com/info-detail-936938.html我们在使用新浪分享的时候,可能会遇到很多问题。比如: java.lang.Throwable: {"error":"{\"error\":\"Insufficient app permissions!\",\"error_code\":10014,\"request\":\"\

2016-03-28 10:39:45 2479 1

原创 iOS-用手机查询手机UDID

请使用 iOS 设备的 Safari 浏览器打开    http://fir.im/udid

2016-02-04 10:51:10 870

原创 iOS-手绘点(类似分段选择器下方突出的小三角)

UIBezierPath *path = [UIBezierPath bezierPath];        CGFloat width = 150.f;    CGFloat height = self.tableView.height;    CGFloat x = (self.width - width) / 2;    CGFloat y = 64.5f;    C

2016-01-20 14:20:45 1454

原创 iOS-Ios8 Xcode6 设置Launch Image 启动图片

http://www.woowen.com/swift/2014/12/12/ios8设置Launch%20Image%20启动图片/

2016-01-12 15:45:05 511

原创 iOS-比较两张图片内容是否相同,判断一个imageView是否有image

首先要把需要做出判断的imageView转成NSData,如果NSData为空,则没有图片if (UIImagePNGRepresentation(_picView.image) == nil) {                data = UIImageJPEGRepresentation(_picView.image, 1);    }    else {

2015-12-17 11:13:50 11986 1

原创 iOS-cocopods换源

Last login: Thu Dec  3 17:02:01 on ttys003lixiangnandeMacBook-Pro:~ lixiangnan$ gem sources -l  //查询pods*** CURRENT SOURCES ***http://rubygems.org/     //查询出来pods源的结果lixiangnande

2015-12-03 17:11:21 665

原创 iOS-iOS8之后,push界面导航栏上方空出20像素

self.automaticallyAdjustsScrollViewInsets = NO;

2015-12-01 11:27:24 3809

原创 iOS-置顶按钮相关

//置顶点击事件- (IBAction)topClick:(UIButton *)sender {    //回到顶部    [self.tableView setContentOffset:CGPointMake(0, 20) animated:YES];        [self.tableView scrollRectToVisible:CGRectMake(0, 0,

2015-11-24 11:47:12 2109

原创 iOS-网页调用百度地图API

UIWebView *webview = [[UIWebView alloc]init];    webview.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);    double latitude =45.748737;    double longitude =12

2015-11-11 11:31:30 2558

原创 iOS-苹果App store 2015最新审核标准公布(2015.3)

http://www.weste.net/2015/03-24/102350.html

2015-10-10 16:18:07 1019

原创 iOS-iOS打开手机QQ与指定用户聊天界面

http://www.2cto.com/kf/201410/347659.html这里只是给了一个别人写好的链接而已。

2015-10-08 16:42:12 536

原创 iOS-xcode7 新特性相关

1.HTTP请求相关在info.plist 右键 -》OpenAs -》Source Code ->加入NSAppTransportSecurityNSAllowsArbitraryLoads2.didFinishLaunchingWithOptions里加入导航页,导致奔溃相关*** Assertion failure in -[UIAppli

2015-09-22 10:49:31 604

原创 iOS-禁用UINavigationController中的轻扫回退的手势

if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {      self.navigationController.interactivePopGestureRecognizer.enabled = NO;  } 这个方法要写在第一个界面。即:

2015-09-15 10:38:55 2995

原创 iOS-判断字符串中是否只含有\n

一个字符串中,只有\n\n\n,通过str.length是不能判断出来的,这个时候str.length=3,所以就要通过以下的方法。 NSString *tempStr =@"\n";       BOOL isAllEnter = YES;       for (int i =0; ilength; i++) {           NSRange ran

2015-09-10 14:02:51 2439

原创 iOS-系统tabbar加选中条

-(void)viewDidAppear:(BOOL)animated{        [superviewDidAppear:animated];        UITabBar *tab =self.view.subviews[1];    tab.layer.borderColor = [UIColorwhiteColor].CGColor;

2015-08-26 14:25:02 1044 1

原创 iOS-pop到想要的界面

for(UIViewController *controllerin self.navigationController.viewControllers) {                   if([controller isKindOfClass:[BMLoginControllerclass]]){                       BMLoginCont

2015-08-26 14:07:01 853

原创 iOS-tabbar控制从首页内容跳转到第二个Controller

AppDelegate *delegate = (AppDelegate *)[[UIApplicationsharedApplication] delegate];    BMBaseTabController *tab = (BMBaseTabController *)delegate.window.rootViewController;    tab.selected

2015-08-26 11:25:02 9143 1

原创 iOS-设置导航栏透明及字体、左右按钮、边框颜色

- (void) setNavBarImg:(UINavigationBar *)navBar{#define kSCNavBarImageTag 10       if ([navBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)])    {        //if iO

2015-08-12 14:05:42 3743

原创 iOS - is missing from working copy

is missing from working copy出现这个问题,是因为svn里面文件的地址,和本地地址不同造成的原因:1.直接拖拽修改文件地址2.svn上文件地址改变之后,没有及时更新暂时只知道这两个。解决方法:针对1:把SVN上原先文件存在的地址删除,更新自己新写的上去。针对2:更新工程,用SVN上得新地址。

2015-08-05 15:57:49 532

原创 iOS-计算两个日期之间的天数

//计算两个日期之间的天数+ (NSInteger) calcDaysFromBegin:(NSDate *)beginDate end:(NSDate *)endDate{//创建日期格式化对象NSDateFormatter *dateFormatter=[[NSDateFormatteralloc] init];[dateFormatter setDat

2015-08-05 10:28:18 6701 3

原创 iOS-检查字段值是否存在为 nil或者 <nil> 或者 NULL的情况

//查错 ,主要是检查字段值是否存在为 nil或者 或者 NULL的情况- (id)checkData:(id)data{       //数组类型   if ([data isKindOfClass:[NSArrayclass]] || [data isKindOfClass:[NSMutableArrayclass]]) {         

2015-06-26 18:02:29 2046

原创 iOS-把大长串的数字做单位处理

#pragma mark - 把大长串的数字做单位处理- (NSString *)changeAsset:(NSString *)amountStr{   if (amountStr && ![amountStr isEqualToString:@""])    {       NSInteger num = [amountStr integerValue];

2015-06-26 18:00:02 2468

转载 iOS-给手势UITapGestureRecognizer添加"tag"标志

UITapGestureRecognizer是没有tag属性,但他有UIView的属性,我们可以通过给UIView添加tag属性,从而标记UITapGestureRecognizer。[objc] view plaincopyUITapGestureRecognizer *singleTap =          [[UITapGesture

2015-06-23 15:21:31 4141

原创 iOS-UITableView 贴在最左侧

UITableView 在8.0系统里面,是距左边有一定距离的,如果想让UITableView贴在左侧,则需要做以下处理。   #define kSystemVersion [[[UIDevice currentDevice] systemVersion] integerValue] [self.tableVIewsetSeparatorInset:

2015-06-23 11:09:08 766

原创 iOS-如何联机调试和发布程序(99$)

在这里只是直接将别人写好的链接收藏来了。感谢原创作者。http://www.cocoachina.com/bbs/read.php?tid-7923-keyword-%C8%E7%BA%CE%C1%AA%BB%FA%B5%F7%CA%D4.html

2015-06-16 10:16:29 781

原创 iOS-AVAudioRecorder、EMCDDeviceManager 报错解决方法

工程集成了环信中录音的功能,在Macmini上运行,录音功能不能实现。error data:2015-06-15 16:18:45.234泰然[4957:233686] 16:18:45.234 ERROR:     98: Error '!obj' trying to fetch default input device's sample rate2015-06-15 16:18

2015-06-15 16:24:03 1593

原创 iOS-UITableView 滚动到底部的方法

1.- (void)scrollsToBottomAnimated:(BOOL)animated{    [self.tableViewscrollToRowAtIndexPath:[NSIndexPathindexPathForRow:self.dataArr.count-1inSection:0] atScrollPosition:UITableViewScro

2015-06-12 14:34:41 17869

原创 iOS-cell可变高度相关

cell高度可变的tableView提升加载速度//这里为可变cell高度计算方法- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{    ManagerCell *cell = (ManagerCell *)[tableView

2015-06-10 10:43:41 656

原创 iOS-集成环信

首先,下载EaseMobSDK然后导入工程然后,编译报错开始:1.BuildPhases   中加入:UIKit.frameworkCoreGraphics.frameworkFoundation.frameworkCFNetwork.frameworkAddressBook.frameworkMobileCoreServices.frameworkSecuri

2015-06-09 16:00:48 983

原创 iOS-MKMapView

- (void)setupMapView {    MKMapView *mapView = [[MKMapViewalloc]initWithFrame:CGRectMake(0,0, self.view.frame.size.width,self.view.frame.size.height)];    mapView.showsUserLocation =YE

2015-06-08 17:24:39 531

原创 iOS-系统导航栏字体修改及自定制导航栏

//更改self.title的字体大小及颜色NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],UITextAttributeTextColor,[UIFont systemFontOfSize:17],UITextAttributeFont,nil];[sel

2015-05-14 20:11:45 792

原创 iOS-UITableView 中自定制cell上UIButton互斥事件

UITableView每行cell有一个UIButton,例如编辑短信记录时候,左边会出现能选中的小圆圈,多选很好完成,如果每一行cell的btn,只能选中一个,这个时候就会出现cell之间btn互斥的问题。1.首先准备一个记录用的UIButton@property(nonatomic,strong) UIButton *selectBtn;2.cellForRow方法中设置,cell

2015-04-28 15:51:37 2779 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除