AnimationDrawable导致OOM内存泄露

问题描述:今天做ZTE,发现反复运行,会OOM。

问题解决:Google了如下解决办法,果然有效。

  1. Move code for AnimationDrawable to onResume() method.
  2. Add following code for releasing memory to onPause().
    ad.stop();
    for (int i = 0; i < ad.getNumberOfFrames(); ++i){
        Drawable frame = ad.getFrame(i);
        if (frame instanceof BitmapDrawable) {
            ((BitmapDrawable)frame).getBitmap().recycle();
        }
        frame.setCallback(null);
    }
    ad.setCallback(null);

UIWebView与CRITTERCISM冲突

问题描述:
今天做TAG,UIWebView有时正常。有时无任何显示,并报如下错误:

2013-12-05 14:49:49.028 TAG[2680:c817] void SendDelegateMessage(NSInvocation *): delegate (webView:decidePolicyForNavigationAction:request:frame:decisionListener:) failed to return after waiting 10 seconds. main run loop mode:

问题解决:
网上搜了一圈。原因是UIKit不支持多线程,必须在主线程上修改。具体原因是UIWebView是CRITTERCISM冲突,UIWebView需要在CRITTERCISM前初始化,但是项目里办不到。因为项目用了Segment.io,所以直接off了。

CocoaPods编译link错误Bug

问题描述:使用CocoaPods加了TestFlight类库:pod 'TestFlightSDK', '~> 2.0.2'

报如下错误:"_OBJC_CLASS_$_TestFlight", referenced from:

问题解决:先是觉得会不会和Crashlytics冲突,结果Google了很多,试了很多,最后试了如下方子成功!

In the Build Settings, do not override "Other Linker Flags". If it is bold, select it press backspace, it should be back to its normal state. If it is not fixed, delete all flags, remove and reinstall Pods and that should fix it.

可能是Other Linker Flags自定义的时候CocoaPods就不更新的关系。

iOS设计开发工具

参考:http://ios.devtools.me

 

内容

LittleIpsum随机文字
lorempixel随机图片

设计

iOS FontsiOS支持字体
App Icon TemplatePhotoshop APP icon设计模板
PrepoAPP icon各尺寸生成
Resizer@2x或者-hd图片自动生成低清版本图片
SlicyPhotoshop自动切图(支持png、jpg、+@2x)
ImageOptimImageAlpha减少图片大小
PaintCode适量画图生成代码
Skala PreviewPhotoshop、Illustrator等同步到iPhone、iPad
xScope测量工具九合一

文档

CocoaDocs在线文档
AppleDoc生成文档
Dash查看文档

类库

GitHub类库查询
SourceTreeGit软件
CocoaPods类库管理

测试

chiselLLDB调试命令增强集

TestFlight测试版本发布
CrashlyticsCrash记录工具

Frankk自动化UI测试

其他

Skala Preview原型设计,相当于APP上的Axure RP
iOS Support Matrix各iOS设备、各iOS版本功能矩阵
Parse推送服务,以及数据储存服务
Particle Designer粒子系统
App Annie统计分析工具
Glyph Designer数据接口访问记录
Developer Color PickerXcode颜色拾取器

SimPholders模拟器目录工具

CocoaDeveloper Quicklook Plugin快速查看.ipa和.mobileprovision信息插件

FuzzyAutocompletePluginXcode5自动完成代码插件

正则表达式

ReggyiOS官方正则表达式类库检查工具

Reginald RegEx explorer第三方正则表达式类库RegexKitLite检查工具

更新CocoaPods需要Xcode命令行工具

问题描述:想更新CocoaPods,在终端运行sudo gem update cocoapods,出现如下错误:

Updating cocoapods
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/xcodeproj-0.13.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/xcodeproj-0.13.1/ext/xcodeproj/gem_make.out

问题解决:Go to Xcode, Preferences -> Downloads,download Command Line Tools.

Parse与-ObjC冲突

问题描述:今天做TAG的时候,加入Parse并加好相应的frame,还是报如下错误:
Undefined symbols for architecture i386:
"_FBTokenInformationExpirationDateKey", referenced from:
-[PFFacebookTokenCachingStrategy cacheTokenInformation:] in Parse(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy expirationDate] in Parse(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setExpirationDate:] in Parse(PFFacebookTokenCachingStrategy.o)
"_FBTokenInformationTokenKey", referenced from:
-[PFFacebookTokenCachingStrategy accessToken] in Parse(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setAccessToken:] in Parse(PFFacebookTokenCachingStrategy.o)
"_FBTokenInformationUserFBIDKey", referenced from:
-[PFFacebookTokenCachingStrategy facebookId] in Parse(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setFacebookId:] in Parse(PFFacebookTokenCachingStrategy.o)
"_OBJC_CLASS_$_FBAppCall", referenced from:
objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
"_OBJC_CLASS_$_FBRequest", referenced from:
objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
"_OBJC_CLASS_$_FBSession", referenced from:
objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
"_OBJC_CLASS_$_FBSessionTokenCachingStrategy", referenced from:
_OBJC_CLASS_$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o)
"_OBJC_METACLASS_$_FBSessionTokenCachingStrategy", referenced from:
_OBJC_METACLASS_$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
问题解决:
方法一:加入FaceBookSDK.framework(>1M)
方法二:设置单独的静态库,使用-force_load /path/libname.a来替换之前的配置-all_load _ObjC
方法三:使用CocoaPods安装Parse

我选择了第三种方法,还是CocoaPods好啊