零零碎碎

来源:互联网 发布:seo新手入门 编辑:程序博客网 时间:2024/05/18 01:37
  1. command+shift+o 搜索整个工程

  2. ctrl+6 查看当前页的方法

  3. xcode下载地址: https://developer.apple.com/downloads/

  4. 友盟SDK第三方登录, 分享: http://www.360doc.com/content/15/0121/14/20919452_442560039.shtml

  5. Xcode升级后, 常遇问题解决:
    http://www.360doc.com/content/14/0806/15/15099545_399859728.shtml

  6. 让工程项目中显示生成的Xcode自带的git文件:
    终端命令: 显示:defaults write com.apple.finder AppleShowAllFiles -bool true
    隐藏:defaults write com.apple.finder AppleShowAllFiles -bool false
    在重启finder, 在强制退出中, 然后可以看到效果
    在把本地项目拖入sourcetree的本地库中时, 会发现sourcetree检测不到, 这时候把xcode自带生成的.git文件删除就OK了.

  7. 代码托管: http://git.oschina.net/

  8. 自定义代码块
    如图: soga
    大框是需要存放的代码片段,
    小框的参数提示可以通过<#代码提示#>来实现, 切记
    把大框中的代码块整个拖入箭头所指, 然后在最下面找到你的代码块, 双击可重命名, 这样一个代码块就完成了!
    最后,Xcode中的代码片段默认放在~/Library/Developer/Xcode/UserData/CodeSnippets下,可以直接拷贝给别人用,资源共享嘛.

  9. 翻墙: 地址 ss.rainman.me
    端口 54082
    加密方式 aes-256-cfb
    密码 hVUme2kq9Rw3
    购买ss账号: https://portal.shadowsocks.com/cart.php
    ss客户端下载: https://github.com/shadowsocks/shadowsocks-iOS/wiki/Shadowsocks-for-OSX-Help
    另一客户端: https://getlittlefox.com
    分享的,莫滥用: http://rainman.me/10.html

  10. 将一段代码定义为宏, 在每一行代码后面加上 \ 这样就可以了

#define CREATEVIEW \UIView *theView = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];    \[self.view addSubview:theView]; \theView.backgroundColor = [UIColor purpleColor];    \
  1. 禁止横屏:
//  在AppDelegate中增加,这个方法可以禁止横屏- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window      {           return UIInterfaceOrientationMaskPortrait;      }
  1. 设置Button的标题右对齐
_rightBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
  1. 获取相册图片的名字, 格式
引入#import <AssetsLibrary/AssetsLibrary.h>, 在- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {    NSURL *imageURL = [info valueForKey:UIImagePickerControllerReferenceURL];    ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset)    {        ALAssetRepresentation *representation = [myasset defaultRepresentation];        NSString *fileName = [representation filename];        NSLog(@"fileName : %@",fileName);    };    ALAssetsLibrary* assetslibrary = [[ALAssetsLibrary alloc] init];    [assetslibrary assetForURL:imageURL                   resultBlock:resultblock                  failureBlock:nil];}
  1. 删除软件安装记录, 在Finder中前往~/Library/Preferences/ByHost,找到其中的GlobalPreferences.…….plist文件,删掉包含有”com.zennaware.Cornerstone”字样的这一行,即清除了安装记录
  2. When opening Xcode looping authentication when installing additional components
    解决: $ /Applications/Xcode-beta.app/Contents/MacOS/Xcode -installComponents
  3. 软件试用期过了试下这条命令: sudo find /private /Users -name Coda -exec rm -rf {}
    Coda是软件名, 未验证, 可以试下
  4. 轮播图第一张图片初加载出来只出来一半, 显示不全, 在控制器中加上: self.automaticallyAdjustsScrollViewInsets = NO;
  5. cocoapods卡在了Setting up CocoaPods master repo不动, “cd ~/.cocoapods/” , “du -sh *” 查看下载进度
  6. cocoapods在xcode8添加三方时要这样:这里写图片描述
  7. // 获取当前时间戳
    // 1) C语言方法
    NSLog(@”__%ld”, time(NULL));
    // OC的
    NSDate* dat = [NSDate dateWithTimeIntervalSinceNow:0];
    NSTimeInterval a=[dat timeIntervalSince1970];
    NSString *timeString = [NSString stringWithFormat:@”%.0f”, a]; // 转为字符型
    NSLog(@”____*%@”, timeString);

    21.清理Xcode中的证书: command + shift + G:
    ~/Library/MobileDevice/Provisioning Profiles
    清理Xcode中的缓存: ~/Library/Developer/Xcode/DerivedData

0 0
原创粉丝点击