`
sking777
  • 浏览: 22851 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论
文章列表
触屏设备都是虚拟键盘,所以当我们开发一些可输入内容的功能时,可能会遇到这样一种情况:弹出的键盘遮挡住了内容展示区,这时候就需要调整内容展示区的位置,让用户能看到自己输入的内容。 那么在iOS下怎么判断键盘是否弹出以及如何获取键盘占据的宽高呢? 其实iOS提供了若干种键盘相关的通知事件: UIKeyboardWillShowNotification UIKeyboardDidShowNotification UIKeyboardWillChangeFrameNotification UIKeyboardDidChangeFrameNotification UIKeyboardWillHideNo ...
1.打开Xcode创建一个“Cocoa Touch Static Library”工程,并删除现有的target 2.右键project选择添加New Target,在弹出的窗口中找到OS X -> Framework & Library ,在右侧窗口中选择“Bundle” 3.target -> Build Settings下面设置下面的几项内容 a.搜索Wrapper Extension,把默认的bundle改成framework b.修改Mach-O Type 为Relocatable Object File c.关闭Dead Code Stripping d.关闭 ...
1. 创建根证书密钥文件(自己做CA)root.key: openssl genrsa -des3 -out root.key 输出内容为: [lenin@archer ~]$ openssl genrsa -des3 -out root.key Generating RSA private key, 512 bit long modulus ……………..++++++++++++ ..++++++++++++ e is 65537 (0×10001) Enter pass phrase for r ...
参考自:http://zhuoqiang.me/jailbroken-ios-device-debug-using-xcode.html 开发 iOS 程序时,如果要在真机上调试,开发者向苹果交 99 美金的年费来取得 iOS 开发者账号。钱虽不多,但有些开发者只想练练手玩一玩 iOS 开发,并不在意能否在 AppSt ...
function open_or_download_app() { if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) { // 判断useragent,当前设备为ios设备 var loadDateTime = new Date(); // 设置时间阈值,在规定时间里面没有打开对应App的话,直接去App store进行下载。 window.setTimeout(function() { var timeOutDateTi ...
有些低概率很难重现的闪退会让程序员很头疼,不知道怎么定位问题,其实是有办法捕获崩溃并获得当时的调用堆栈的。拿到堆栈保存下来,找个合适的时机回传到服务器给se分析,可以大大提高修复闪退的工作效率。 首先定义一个捕获异常的NSUncaughtExceptionHandler void exceptionHandler(NSException *exception) {     NSLog(@"exit with exception: %@", [exception reason]); // reason为崩溃原因描述     NSLog(@"%@", [ex ...
信号参考对照表: SIGABRT 由调用abort函数产生,进程非正常退出 SIGALRM 用alarm函数设置的timer超时或setitimer函数设置的interval timer超时 SIGBUS 某种特定的硬件异常,通常由内存访问引起 SIGCANCEL 由Solaris Thread Library内部使用,通常不会使用 SIGCHLD 进程Terminate或Stop的时候,SIGCHLD会发送给它的父进程。缺省情况下该Signal会被忽略 SIGCONT 当被stop的进程恢复运行的时候,自动发送 SIGEMT 和实现相关的硬件异常 SIGFPE 数学相关的异常,如被0除,浮点溢 ...
Mac OS X: MobileDevice.framework Location: /System/Library/PrivateFrameworks/MobileDevice.framework Export command: nm /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice 参考: http://theiphonewiki.com/wiki/MobileDevice_Library#Mac_OS_X:_MobileDevice.framework
参考 http://help.apple.com/iosdeployment-apps/mac/1.1/#app43ad871e
Step1 : unzip YourApp.ipa Step2:  rm -rf Payload/YourApp.app/_CodeSignature Step3:  cp InHouse.mobileprovision Payload/YourApp.app/embedded.mobileprovision Step4:  /usr/bin/codesign -f -s "iPhone Distribution: YourCompanyName" --resource-rules Payload/YourApp.app/ResourceRules.plist Pay ...
继承并实现一个ContentProvider package com.packagename.provider; public class MyProvider extends ContentProvider {      @Override      public ParcelFileDescriptor openFile(Uri uri, String mode){         URI fileURI = URI.create( "file://" + uri.getPath() );         File file = new File( fileURI ); ...

iOS滤镜

// 对静态图像进行模糊处理 - (UIImage *)blurImage:(CGImageRef)srcImg {     // 创建CIContext,这里关闭color management有助于提升性能     NSDictionary *options = @{ kCIContextWorkingColorSpace : [NSNull null] };     CIContext *mContext = [CIContext contextWithOptions:options];     CIImage *mImg = [[CIImage alloc] initWithCGIma ...
例: dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{      // 耗时的操作      dispatch_async(dispatch_get_main_queue(), ^{          // 更新界面      });  }); 参考: https://developer.apple.com/library/ios/documentation/Performance/Reference/GCD_libdispatch_Ref/Reference/refere ...

有用的系统工具

一些不是很常用,但有用的系统工具。可能是系统自带的,或者可以yum安装的,或者可以很容易安装的 iftop 实时网络带宽,按ip区别 iptraf 流量监控 slabtop kernel内存使用情况 htop 更好用的top ethtool 网卡状态 mpstat 单个cpu的使用情况 diskstats iostat的代替品 wget aspersa.googlecode.com/svn/trunk/diskstats summary 系统信息收集 wget aspersa.googlecode.com/svn/trunk/summary lsof 查看进程打开的文件 fuser 查找使用文 ...
netstat -antp | grep 80
Global site tag (gtag.js) - Google Analytics