<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>iPhone 开发技术</title>
    <link rel="alternate" type="text/html" href="http://iphone.ipsw.info/" />
    <link rel="self" type="application/atom+xml" href="http://iphone.ipsw.info/atom.xml" />
    <id>tag:iphone.ipsw.info,2009-09-30://3</id>
    <updated>2012-04-28T07:05:27Z</updated>
    <subtitle>CocoaTouch,Objective-C,CoreAnimation</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.37</generator>

<entry>
    <title>传函数pass function as callback </title>
    <link rel="alternate" type="text/html" href="http://iphone.ipsw.info/2012/04/pass-function-as-callback.html" />
    <id>tag:iphone.ipsw.info,2012://3.402</id>

    <published>2012-04-28T06:33:08Z</published>
    <updated>2012-04-28T07:05:27Z</updated>

    <summary><![CDATA[office API sample&nbsp;Boolean CFReadStreamSetClient(CFReadStreamRef stream, CFOptionFlags streamEvents, CFReadStreamClientCallBack clientCB, CFStreamClientContext *clientContext);callback function define&nbsp;typedef void (*CFReadStreamClientCallBack)(CFReadStreamRef stream, CFStreamEventType type, void *clientCallBackInfo);how to use?&nbsp;1 define use typedef style&nbsp;void AFReadStreamCallBack ( &nbsp;CFReadStreamRef aStream, &nbsp;CFStreamEventType eventType, &nbsp;void* inClientInfo &nbsp;); void AFReadStreamCallBack ( &nbsp;CFReadStreamRef aStream,...]]></summary>
    <author>
        <name>孔祥波</name>
        
    </author>
    
        <category term="Coding" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="applicationprogramminginterface" label="Application programming interface" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="callback" label="Callback" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="stream" label="Stream" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="typedef" label="Typedef" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="voidtype" label="Void type" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://iphone.ipsw.info/">
        <![CDATA[<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; "><font color="#78492a">office API sample&nbsp;</font></p><p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; "></p><p style="margin-bottom: 0px; font-size: 18px; color: rgb(112, 61, 170); ">Boolean<span style="color: #000000"> CFReadStreamSetClient(</span>CFReadStreamRef<span style="color: #000000"> stream, </span>CFOptionFlags<span style="color: #000000"> streamEvents, </span>CFReadStreamClientCallBack<span style="color: #000000"> clientCB, </span>CFStreamClientContext<span style="color: #000000"> *clientContext);</span></p><p style="margin-bottom: 0px; font-size: 18px; color: rgb(112, 61, 170); "><span style="color: #000000">callback function define&nbsp;</span></p><p style="margin-bottom: 0px; font-size: 18px; "></p><p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; "><span style="color: #bb2ca2">typedef</span> <span style="color: #bb2ca2">void</span> (*CFReadStreamClientCallBack)(CFReadStreamRef stream, CFStreamEventType type, <span style="color: #bb2ca2">void</span> *clientCallBackInfo);</p><p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; ">how to use?&nbsp;</p><p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; ">1 define use typedef style&nbsp;</p><p style="margin-bottom: 0px; font-size: 18px; "></p><p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; "><span style="color: #bb2ca2">void</span> AFReadStreamCallBack</p>
<p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; ">(</p>
<p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; "><span style="color: #000000">&nbsp;</span>CFReadStreamRef<span style="color: #000000"> aStream,</span></p>
<p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; "><span style="color: #000000">&nbsp;</span>CFStreamEventType<span style="color: #000000"> eventType,</span></p>
<p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; ">&nbsp;<span style="color: #bb2ca2">void</span>* inClientInfo</p>
<p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; ">&nbsp;);</p>
<p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; "><span style="color: #bb2ca2">void</span> AFReadStreamCallBack</p>
<p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; ">(</p>
<p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; "><span style="color: #000000">&nbsp;</span>CFReadStreamRef<span style="color: #000000"> aStream,</span></p>
<p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; "><span style="color: #000000">&nbsp;</span>CFStreamEventType<span style="color: #000000"> eventType,</span></p>
<p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; ">&nbsp;<span style="color: #bb2ca2">void</span>* inClientInfo</p>
<p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; ">&nbsp;)</p>
<p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; ">{</p>
<p style="margin-bottom: 0px; font-size: 18px; "><span class="Apple-tab-span" style="color: rgb(112, 61, 170); white-space: pre; ">	</span><font color="#4f8187">//do something</font></p>
<p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; ">}</p><p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; ">2 setup callback&nbsp;</p><p style="color: rgb(112, 61, 170); margin-bottom: 0px; font-size: 18px; "></p><p style="margin-bottom: 0px; font-size: 18px; ">&nbsp; &nbsp;&nbsp;CFStreamClientContext context = {<span style="color: #272ad8">0</span>, (<span style="color: #bb2ca2">__bridge</span> <span style="color: #bb2ca2">void</span> *)(<span style="color: #bb2ca2">self</span>), <span style="color: #bb2ca2">NULL</span>, <span style="color: #bb2ca2">NULL</span>, <span style="color: #bb2ca2">NULL</span>};</p>
<p style="margin-bottom: 0px; font-size: 18px; color: rgb(61, 29, 129); "><span style="color: #000000">&nbsp; &nbsp; </span>CFReadStreamSetClient<span style="color: #000000">(</span></p>
<p style="margin-bottom: 0px; font-size: 18px; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #4f8187">stream</span>,</p>
<p style="margin-bottom: 0px; font-size: 18px; color: rgb(61, 29, 129); "><span style="color: #000000">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>kCFStreamEventNone<span style="color: #000000">|</span>kCFStreamEventHasBytesAvailable<span style="color: #000000"> | </span>kCFStreamEventErrorOccurred<span style="color: #000000"> | </span>kCFStreamEventEndEncountered<span style="color: #000000">|</span>kCFStreamEventOpenCompleted<span style="color: #000000">,</span></p>
<p style="margin-bottom: 0px; font-size: 18px; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #31595d">AFReadStreamCallBack</span>,</p>
<p style="margin-bottom: 0px; font-size: 18px; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp;context);</p>
<p style="margin-bottom: 0px; font-size: 18px; color: rgb(61, 29, 129); "><span style="color: #000000">&nbsp; &nbsp; </span>CFReadStreamScheduleWithRunLoop<span style="color: #000000">(</span><span style="color: #4f8187">stream</span><span style="color: #000000">, </span>CFRunLoopGetCurrent<span style="color: #000000">(), </span><span style="color: #703daa">kCFRunLoopCommonModes</span><span style="color: #000000">);</span></p><p style="margin-bottom: 0px; font-size: 18px; color: rgb(61, 29, 129); "><span style="color: #000000"><br /></span></p><p style="margin-bottom: 0px; font-size: 18px; "><font color="#000000">design callback sample code</font></p><p style="margin-bottom: 0px; font-size: 18px; color: rgb(61, 29, 129); "><span style="color: #000000"><br /></span></p><p></p><p></p><p></p><p></p><p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; color: rgb(209, 47, 27); "><span style="color: #78492a">#import </span>"AppDelegate.h"</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; color: rgb(187, 44, 162); ">typedef<span style="color: #000000"> </span>void<span style="color: #000000"> (*PF)(</span>int<span style="color: #000000"> x);</span></p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; "><span style="color: #bb2ca2">void</span> func(<span style="color: #bb2ca2">int</span> x)</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">{</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; color: rgb(209, 47, 27); "><span style="color: #000000">&nbsp; &nbsp; </span><span style="color: #3d1d81">NSLog</span><span style="color: #000000">(</span>@"func x*x=%d"<span style="color: #000000">,x*x);</span></p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; min-height: 21px; ">&nbsp;&nbsp; &nbsp;</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">}</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; "><span style="color: #bb2ca2">void</span> caller(<span style="color: #4f8187">PF</span> pf,<span style="color: #bb2ca2">int</span> a,<span style="color: #bb2ca2">int</span> b)</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">{</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">&nbsp; &nbsp; <span style="color: #bb2ca2">int</span> x = a+b;</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">&nbsp; &nbsp; pf(x);</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">}</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; color: rgb(187, 44, 162); ">@implementation<span style="color: #000000"> AppDelegate</span></p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; min-height: 21px; "><br /></p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">-(<span style="color: #bb2ca2">void</span>)caller:(<span style="color: #4f8187">PF</span>)pf a:(<span style="color: #bb2ca2">int</span>)a b:(<span style="color: #bb2ca2">int</span>) b</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">{</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">&nbsp; &nbsp; <span style="color: #bb2ca2">int</span> x = a+b;</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">&nbsp; &nbsp; pf(x);</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">}</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">- (<span style="color: #bb2ca2">void</span>)dealloc</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">{</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">&nbsp; &nbsp; [<span style="color: #bb2ca2">super</span> <span style="color: #3d1d81">dealloc</span>];</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">}</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; min-height: 21px; "><br /></p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">- (<span style="color: #bb2ca2">void</span>)applicationDidFinishLaunching:(<span style="color: #703daa">NSNotification</span> *)aNotification</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">{</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">&nbsp; &nbsp; <span style="color: #4f8187">PF</span> p1&nbsp; = <span style="color: #31595d">func</span>;</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">&nbsp; &nbsp; <span style="color: #31595d">caller</span>(p1,<span style="color: #272ad8">9</span>,<span style="color: #272ad8">10</span>);</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">&nbsp; &nbsp; [<span style="color: #bb2ca2">self</span> <span style="color: #31595d">caller</span>:p1 <span style="color: #31595d">a</span>:<span style="color: #272ad8">199</span> <span style="color: #31595d">b</span>:<span style="color: #272ad8">8</span>];</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; color: rgb(0, 132, 0); "><span style="color: #000000">&nbsp; &nbsp; </span>// Insert code here to initialize your application</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">}</p><p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; "><br /></p><p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">caller 实现私有，指定义callback样式，不实现，具体实现是使用时候根据业务逻辑实现</p><p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">C 语言的callback 和ObjC里面的protocol 是不是十分类似？</p><p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; "><br /></p><p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; "><br /></p>

<div class="zemanta-pixie" style="margin-top:10px;height:15px"><a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"><img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=20cf3ea8-43f3-4125-8ac4-17eae706d2cb" alt="Enhanced by Zemanta" style="border:none;float:right" /></a></div>]]>
        
    </content>
</entry>

<entry>
    <title>国内App市场&quot;烂透了&quot;？</title>
    <link rel="alternate" type="text/html" href="http://iphone.ipsw.info/2012/04/app.html" />
    <id>tag:iphone.ipsw.info,2012://3.401</id>

    <published>2012-04-28T02:36:17Z</published>
    <updated>2012-04-28T02:37:07Z</updated>

    <summary><![CDATA[来自&nbsp;http://www.it-times.com.cn/　　4月26日，世界知识产权日，所有登录网易邮箱的用户都会看到这样一幅画面：左边一个艺术家打扮的人画出了一只叼着橄榄枝的洁白鸽子，右边一个身上打着补丁、乞丐状的人边张望"艺术家"的作品，边在画布相同位置描出一只嘴里叼野花、眼歪鼻斜的企鹅。图上配文是："与其山寨百分之一的灵感，不如复制百分之百的汗水"。看来，网易与腾讯之间围绕新闻客户端抄袭的"掐架"还会继续下去。&nbsp;　　与国内形成鲜明对比的是，国外App业态健康，团队才13个人的图片分享应用Instagram被Facebook以10亿美元收购，私人图片分享服务Path估值也迅速上升到2.5亿美元，App开发是一门依靠创新能实现巨大利润的生意。"国内的创意型中小团队却不可能被大公司收购，后者反而会很快山寨一个类似应用，很快你就死了。"资深iOS程序开发者、iApp4Me创始人郝培强表示。　　IT时报记者 忻云　　1 用户界面抄袭"分分钟搞定"　　如果你在对比最近涉嫌抄袭的两个客户端后发现外观"太像了"，并且感到愤怒，那你一定是第一天踏入这个圈子的人。"微书架"App创始人许锡标对于这种UI(用户界面)设计雷同的现象早已见怪不怪。　　"人家设计师辛辛苦苦设计的图片，用不了半个小时，就可以被某些别有用心的人利用。"许锡标说，他以大热的美国应用Path为例，演示了十分简单的抄袭过程，下载Path，导出ipa文件，把ipa文件解压，就能看到Path所有的图片文件："这些图片文件一般是png文件，直接打开是看不了的。这时，需要再下载一个修复png的软件，批量修复一下，就能看到所有图片文件。这样就把Path的整个UI给盗了。就这么简单。"　　易传媒移动互联网软件工程师小柯称，安卓应用的山寨更简单，将APK文件名改为RAR后解压，应用中的图片都在RES文件夹内，"连代码什么的都可以看到。"　　Fresh-Ideas工作室的开发者王均最近就认为其作品"全国空气污染指数"安卓版中一张原创图片被某公司改也不改地直接用于另一款应用。"那张坐标轴图片由多种色彩按特殊配色方案混搭而成，是我们团队反复琢磨的产物，相信天下不可能找到一模一样的。所以我很奇怪，下载对方应用打开图片文件夹后，发现根本就是用我的原始图片。"怪只怪，安卓的图片太容易复制。　　iApp4Me创始人郝培强说，就算初创设计者做一些加密也没有用，对方觉得你的UI好，完全可以将图片截屏。由此带来的"盗版"速度非常快，Instagram被Facebook收购后，图片分享类应用被大为看好，Path立即成为国内山寨的下一个热点，目前已有10多个类Path应用出现在国内市场。　　软件抄袭自PC时代就有，但在移动App上如此密集地发生，主要是屏幕相对缩小后，用户体验的要求更高，通常用户下载App后首先看"应用是否好看"，这方面的重视度远超PC端。"在PC上即使一款软件操作起来不太舒服，用鼠标也比较容易克服，软件间的差别感受没那么大。但在手机屏上一个优秀的UI，一个舒服的按键位置对用户吸引力巨大，对复制者的诱惑也同样增长。"郝培强表示。　　...]]></summary>
    <author>
        <name>孔祥波</name>
        
    </author>
    
    <category term="facebook" label="Facebook" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ios" label="IOS" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="iphone" label="IPhone" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="socialnetwork" label="Social network" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="twitter" label="Twitter" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://iphone.ipsw.info/">
        <![CDATA[<span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">来自&nbsp;</span><a href="http://www.it-times.com.cn/" target="_blank" style="word-wrap: break-word; text-decoration: none; color: rgb(0, 153, 204); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; ">http://www.it-times.com.cn/</a><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　4月26日，世界知识产权日，所有登录网易邮箱的用户都会看到这样一幅画面：左边一个艺术家打扮的人画出了一只叼着橄榄枝的洁白鸽子，右边一个身上打着补丁、乞丐状的人边张望"艺术家"的作品，边在画布相同位置描出一只嘴里叼野花、眼歪鼻斜的企鹅。图上配文是："与其山寨百分之一的灵感，不如复制百分之百的汗水"。看来，网易与腾讯之间围绕新闻客户端抄袭的"掐架"还会继续下去。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><img src="http://tiny4cocoa.com/attachments/month_1204/1204281011ab77e86e404f3403.png" file="attachments/month_1204/1204281011ab77e86e404f3403.png" width="412" id="aimg_509" alt="屏幕快照 2012-04-28 上午10.07.59.png" style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">&nbsp;</span><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; "></span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　与国内形成鲜明对比的是，国外App业态健康，团队才13个人的图片分享应用Instagram被Facebook以10亿美元收购，私人图片分享服务Path估值也迅速上升到2.5亿美元，App</span><span href="tag.php?name=%E5%BC%80%E5%8F%91" class="t_tag" style="word-wrap: break-word; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; ">开发</span><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">是一门依靠创新能实现巨大利润的生意。"国内的创意型中小团队却不可能被大公司收购，后者反而会很快山寨一个类似应用，很快你就死了。"资深</span><span href="tag.php?name=iOS" class="t_tag" style="word-wrap: break-word; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; ">iOS</span><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">程序</span><span href="tag.php?name=%E5%BC%80%E5%8F%91%E8%80%85" class="t_tag" style="word-wrap: break-word; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; ">开发者</span><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">、</span><a href="http://iapp4me.com/" target="_blank" style="word-wrap: break-word; text-decoration: none; color: rgb(0, 153, 204); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; ">iApp4Me</a><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">创始人郝培强表示。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　IT时报记者 忻云</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　1 用户界面抄袭"分分钟搞定"</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　如果你在对比最近涉嫌抄袭的两个客户端后发现外观"太像了"，并且感到愤怒，那你一定是第一天踏入这个圈子的人。"微书架"App创始人许锡标对于这种UI(用户界面)设计雷同的现象早已见怪不怪。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　"人家设计师辛辛苦苦设计的图片，用不了半个小时，就可以被某些别有用心的人利用。"许锡标说，他以大热的美国应用Path为例，演示了十分简单的抄袭过程，下载Path，导出ipa文件，把ipa文件解压，就能看到Path所有的图片文件："这些图片文件一般是png文件，直接打开是看不了的。这时，需要再下载一个修复png的软件，批量修复一下，就能看到所有图片文件。这样就把Path的整个UI给盗了。就这么简单。"</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　易传媒</span><span href="tag.php?name=%E7%A7%BB%E5%8A%A8%E4%BA%92%E8%81%94%E7%BD%91" class="t_tag" style="word-wrap: break-word; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; ">移动互联网</span><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">软件</span><span href="tag.php?name=%E5%B7%A5%E7%A8%8B%E5%B8%88" class="t_tag" style="word-wrap: break-word; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; ">工程师</span><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">小柯称，安卓应用的山寨更简单，将APK文件名改为RAR后解压，应用中的图片都在RES文件夹内，"连代码什么的都可以看到。"</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　Fresh-Ideas工作室的开发者王均最近就认为其作品"全国空气污染指数"安卓版中一张原创图片被某公司改也不改地直接用于另一款应用。"那张坐标轴图片由多种色彩按特殊配色方案混搭而成，是我们团队反复琢磨的产物，相信天下不可能找到一模一样的。所以我很奇怪，下载对方应用打开图片文件夹后，发现根本就是用我的原始图片。"怪只怪，安卓的图片太容易复制。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　iApp4Me创始人郝培强说，就算初创设计者做一些加密也没有用，对方觉得你的UI好，完全可以将图片截屏。由此带来的"盗版"速度非常快，Instagram被Facebook收购后，图片分享类应用被大为看好，Path立即成为国内山寨的下一个热点，目前已有10多个类Path应用出现在国内市场。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　软件抄袭自PC时代就有，但在移动App上如此密集地发生，主要是屏幕相对缩小后，用户体验的要求更高，通常用户下载App后首先看"应用是否好看"，这方面的重视度远超PC端。"在PC上即使一款软件操作起来不太舒服，用鼠标也比较容易克服，软件间的差别感受没那么大。但在手机屏上一个优秀的UI，一个舒服的按键位置对用户吸引力巨大，对复制者的诱惑也同样增长。"郝培强表示。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　</span>]]>
        <![CDATA[<span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">2 你抄我，我抄他</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　当你说别人抄袭的时候，自己却也成了其它应用开发者的攻击目标。螳螂捕蝉，黄雀总是在后，这不只发生在近期控诉腾讯的网易身上。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　热门</span><span href="tag.php?name=%E6%B8%B8%E6%88%8F" class="t_tag" style="word-wrap: break-word; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; ">游戏</span><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">"捕鱼达人"曾表示自己的山寨应用多达100多款，其中也包括腾讯。但这款游戏自身却也受到"抄袭"的指责。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　一些游戏玩家发现在"卡通尼"等大型游艺城曾玩过一款十分相似的街机版"捕鱼游戏"。老K游戏联合创始人黄剑表示，街机上的游戏正是由该团队最早于2009年原创，并且在2011年4月推出iOS版本，但是当时却发现20天之前触控科技已推出一款《捕鱼达人》，黄剑认为后者抄袭痕迹明显。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　触控科技CEO陈昊芝(微博)针对这一质疑向记者表示："我们从来没有不承认借鉴了这款街机游戏，但肯定是有创新的，从摇杆的操作变为触控操作，从用户需要付钱玩变成免费玩，这些都是创新。如今也有很多手机游戏来自于任天堂以往的经典游戏等，游戏的玩法没有规定不允许重复。"</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　不过，将街机移植到手机上，显然必须将操控方式从摇杆变为触屏，也肯定不能像大型游艺城那样要求投游戏币来玩，这些改变就是创新？黄剑并不信服："游戏主体上基本和我们一样，鱼阵游动、用炮打鱼等基本都是我们的创意，我认为没有本质上的创新。"</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　同样地，卓亨最近对旗下游戏《守卫者》遭遇山寨感到十分愤怒，但也有开发者表示该公司最为知名的游戏《切水果》有山寨版《水果忍者》之嫌......</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　令郝培强感到失落的是，最近这一年多来，App Store中出现的让用户眼前一亮的App差不多都来自美国，在中国区这样的惊喜几乎没有。"一眼望去都是一样的东西。"郝培强说，现在的态势几乎是美国人负责创新，中国人负责模仿，当市场已经有10多款同样模仿美国的应用时，国内开发者之间谁抄袭谁也显得很无谓，本质上是创新乏力。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　艾媒咨询董事长张毅告诉记者，据之前的调查数字，国内手机游戏市场正版仅占1.4%，而山寨版则高达34.2%。在苹果iOS平台上，热门游戏只占整体游戏数量的1.9%，山寨版占21.8%。大量游戏扎堆于跳跃、捕猎、塔防等集中的主题，缺乏突破性创意，造成彼此间除了美术设计外均十分雷同，界定抄袭十分困难。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　3 创新App的喉咙被掐住</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　在中国，App创新者很难自比Instagram的开发者们。一位不愿透露姓名的开发者表示，他从来没有做过被腾讯、百度(微博)等公司收购之类的美梦，只是希望自己的应用能绕开大公司主要关注的方向，获得一些不被复制的喘息时间来积累用户。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　美国的App创新者被收购，而中国的中小开发者由于遭到复制，很容易死掉，一些业内人士似乎都有这样的共识。张毅表示，在美国反不正当竞争法的实施比较成熟，抄袭者被告的几率很大，收购成了大公司传统思维的一部分。而在中国，包括之前的UC</span><span href="tag.php?name=%E6%B5%8F%E8%A7%88%E5%99%A8" class="t_tag" style="word-wrap: break-word; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; ">浏览器</span><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">与QQ浏览器之争等都没有最终的结论："导致许多巨头认为复制能带来更好的成本控制。"</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　中国应用市场过于渠道化也是其中关键原因，开发者通过健康方式实现用户增长难度很大。比如，在水货手机刷ROM(中文操作系统)的环节，不少应用开发者就与中间商达成协议，将应用预装在手机中。"曾经有一个用户买到手机，其中预装了6个手机浏览器。"郝培强表示。如果中小开发者的创意被更有资金实力的公司山寨，并迅速预装于手机，随着装机量的上升很快就会在用户数量上被对方压倒，难以翻身。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　另外，App Store中国区刷榜现象严重，应用排名的现状往往与创新性无关，当一些背景雄厚的雷同应用占据了推广位，消费者已很难分辨谁是原创，缺乏推广资金的中小团队产品很快就会被淹没。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　黄剑说，以往推广网页版捕鱼游戏并不需要做广告，但由于iOS平台上出现大量捕鱼游戏，其每月投放广告的成本被推到200万元左右："如果是比我们更小的团队，从一开始就会无法支撑。"</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　4 开发者带着源代码跳槽</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　困惑并不仅仅来自刚涉足这一行业的中小团队，也包括成功团队。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　在国内</span><span href="tag.php?name=App%E5%BC%80%E5%8F%91" class="t_tag" style="word-wrap: break-word; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; ">App开发</span><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">圈里，139.me是一个颇有来头的名字。它最早涉足</span><span href="tag.php?name=iPhone" class="t_tag" style="word-wrap: break-word; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; ">iPhone</span><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">软件原创开发，并获得百万次下载的国内团队之一。仅靠"多彩水族箱"这款游戏，139.me每天的收入就超过1000美元。2009年时其CEO朱连兴在那些梦想挖到第一桶金的草根创业者眼中就是一夜暴富的最佳模仿目标。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　然而最近朱连兴却感到发展遭遇很大的现实问题，烦恼原因也是同样的----抄袭。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　不久前139.me刚在App Store上对一款雷同应用提起了下架诉求，而对方的身份让朱连兴很痛心，因为正是从其团队中出走的员工。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　2008年在河北时与朱连兴一同创业的只有两三人，他们一起经历了艰苦奋斗。"那时App创新比较单纯，因为进入者没有那么多，抄袭也没有那么严重。"他回忆。但在2010年搬到</span><span href="tag.php?name=%E5%8C%97%E4%BA%AC" class="t_tag" style="word-wrap: break-word; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; ">北京</span><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">后，朱连兴发现团队中一些成员接触的人变得很杂，甚至腾讯等公司的挖人电话直接打到了公司里，这个行业的诱惑变得很大。不少被公司看好、并且已经签署协议的大学毕业生在经过长期的打磨后，却忽然因为其他公司的</span><span href="tag.php?name=%E9%AB%98%E8%96%AA" class="t_tag" style="word-wrap: break-word; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; ">高薪</span><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">诱惑抛下项目走了。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　"一个产品到了关键阶段，主要做程序的人却跑掉了，这对我们的影响太大了。"朱连兴表示，而且年轻人带走的还有属于这个产品独特的创意文化。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　更令他没有想到的是，不久前竟然有一位甘苦多年的元老在离职时将应用源代码也一并带走，并组织起自己的团队，推出类似的应用。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　"这个行业很奇怪，似乎没有是非标准，也没有批评的意识。看到某一个人是从139.me这样的知名团队出来的，只看中他的经验，从来不会问他手里的东西是怎么来的。"面对雷同的产品，朱连兴只能向App Store申诉，但提到走法律途径维权的可能，他觉得所需时间和成本太多。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　"像国外开发团队那样的凝聚力似乎很难，没有规矩就没有竞争可言，这是整个行业缺乏职业操守所致。"朱连兴表示。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　记者手记</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　监管不力导致底线失守</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　在你对某一款应用爱不释手时，是否想到这背后或许有不为人知的血泪史？从创意的抄袭到完全复制UI，将原创的内容改也不改就加以使用，快速吸金的浮躁心态是这个行业野蛮生长的潜在诱因，而监管不力则是底线一再失守的现实因素。</span><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><br style="word-wrap: break-word; color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; text-align: left; " /><span style="color: rgb(68, 68, 68); font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; text-align: left; ">　　在一个新兴行业快速兴起时，法律和行业规范常常跟不上其迅速的脚步。但当与抄袭相伴的刷榜、黑卡、色情应用泛滥等不良现象集中在国内市场呈现，当一些开发者用"烂透了"这样的哀叹来形容周边氛围时，反观国外，无法不令人感到汗颜。</span>

<div class="zemanta-pixie" style="margin-top:10px;height:15px"><a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"><img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=11b62458-c45e-4a10-9766-fdc24afdb15f" alt="Enhanced by Zemanta" style="border:none;float:right" /></a></div>]]>
    </content>
</entry>

<entry>
    <title>iOS Music app widget</title>
    <link rel="alternate" type="text/html" href="http://iphone.ipsw.info/2012/04/ios-music-app-widget-1.html" />
    <id>tag:iphone.ipsw.info,2012://3.400</id>

    <published>2012-04-25T03:15:30Z</published>
    <updated>2012-04-25T03:36:35Z</updated>

    <summary><![CDATA[iOS 5.0 增加&nbsp;MPNowPlayingInfoCenterUse a now playing info center to set now-playing information for media being played by your app.The system displays now-playing information on the device lock screen and in the multimedia controls in the multitasking UI. If the user...]]></summary>
    <author>
        <name>孔祥波</name>
        
    </author>
    
        <category term="iOS" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="airplay" label="AirPlay" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="apple" label="Apple" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ios" label="IOS" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ipad" label="IPad" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="iphone" label="IPhone" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ipod" label="iPod" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="macosx" label="Mac OS X" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://iphone.ipsw.info/">
        <![CDATA[iOS 5.0 增加&nbsp;<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; border-spacing: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px; ">MPNowPlayingInfoCenter</span></span><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; border-spacing: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px; "><p class="abstract" style="margin-top: 1.083em; margin-bottom: 0.833em; font-size: 100%; ">Use a now playing info center to set now-playing information for media being played by your app.</p><p style="margin-bottom: 0.833em; font-size: 100%; ">The system displays now-playing information on the device lock screen and in the multimedia controls in the multitasking UI. If the user directs playback of your media to Apple TV via AirPlay, the now-playing information appears on the television screen. If the user connects a device to an iPod accessory, such as in a car, the accessory may display now-playing information.&nbsp;</p><p style="margin-bottom: 0.833em; font-size: 100%; ">支持lock screen, AirPlay ,iPod accessory, 欢喜</p><p style="margin-bottom: 0.833em; font-size: 100%; ">看看sample code</p><p style="margin-bottom: 0.833em; font-size: 100%; "></p><p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">-(<span style="color: #bd23a0">void</span>)updateInfoCenter:(<span style="color: #743aa7">UIImage</span>*)cover</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">{</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; color: rgb(116, 58, 167); "><span style="color: #000000">&nbsp; &nbsp; </span>MPNowPlayingInfoCenter<span style="color: #000000"> *infoCenter=[</span>MPNowPlayingInfoCenter<span style="color: #000000"> </span><span style="color: #411a7f">defaultCenter</span><span style="color: #000000">];</span></p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; color: rgb(116, 58, 167); "><span style="color: #000000">&nbsp; &nbsp; </span>NSMutableDictionary<span style="color: #000000"> *info=[[</span>NSMutableDictionary<span style="color: #000000"> </span><span style="color: #411a7f">alloc</span><span style="color: #000000">] </span><span style="color: #411a7f">initWithCapacity</span><span style="color: #000000">:</span><span style="color: #3724d4">2</span><span style="color: #000000">];</span></p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; color: rgb(116, 58, 167); "><span style="color: #000000">&nbsp; &nbsp; [info </span><span style="color: #411a7f">setObject</span><span style="color: #000000">:</span><span style="color: #4e8187">currentSong</span><span style="color: #000000">.</span>Artist<span style="color: #000000"> </span><span style="color: #411a7f">forKey</span><span style="color: #000000">:</span>MPMediaItemPropertyArtist<span style="color: #000000">];</span></p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; color: rgb(116, 58, 167); "><span style="color: #000000">&nbsp; &nbsp; [info </span><span style="color: #411a7f">setObject</span><span style="color: #000000">:[</span><span style="color: #4e8187">currentSong</span><span style="color: #000000"> </span><span style="color: #31595d">nameStr</span><span style="color: #000000">] </span><span style="color: #411a7f">forKey</span><span style="color: #000000">:</span>MPMediaItemPropertyTitle<span style="color: #000000">];</span></p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; color: rgb(116, 58, 167); "><span style="color: #000000">&nbsp; &nbsp; </span>MPMediaItemArtwork<span style="color: #000000"> *itemwork=[[</span>MPMediaItemArtwork<span style="color: #000000"> </span><span style="color: #411a7f">alloc</span><span style="color: #000000">] </span><span style="color: #411a7f">initWithImage</span><span style="color: #000000">:cover];</span></p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; color: rgb(116, 58, 167); "><span style="color: #000000">&nbsp; &nbsp; [info </span><span style="color: #411a7f">setObject</span><span style="color: #000000">:itemwork </span><span style="color: #411a7f">forKey</span><span style="color: #000000">:</span>MPMediaItemPropertyArtwork<span style="color: #000000">];</span></p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">&nbsp; &nbsp; [infoCenter <span style="color: #411a7f">setNowPlayingInfo</span>:info];</p>
<p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">}</p><p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; ">官方说明</p><p style="margin-bottom: 0px; font-family: Menlo; font-size: 18px; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Times; border-spacing: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px; "></span></span></p><h1 id="pageTitle" style="margin-bottom: 1.15em; font-size: 215%; padding-top: 24px; ">Enriching Your App for AirPlay</h1><div><span class="Apple-style-span" style="border-collapse: separate; font-family: Times; border-spacing: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px; "><section><h2 class="jump" style="margin-top: 1.75em; font-size: 24px; color: rgb(60, 76, 108); padding-bottom: 2px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(131, 145, 168); ">Provide Audio Metadata</h2><p style="margin-bottom: 0.833em; font-size: 100%; ">Your audio may be playing on a big-screen home theater system or on a sound system with an LCD display. Your app gives a better user experience if you provide metadata that can be shown on the AirPlay device's display, such as the artist name, song title, and album art.</p><p style="margin-bottom: 0.833em; font-size: 100%; ">Add metadata by passing a dictionary into the&nbsp;<code style="font-size: 13px; font-family: Courier, Consolas, monospace; color: rgb(102, 102, 102); ">setNowPlayingInfo</code>&nbsp;method of&nbsp;<code style="font-size: 13px; font-family: Courier, Consolas, monospace; color: rgb(102, 102, 102); ">MPNowPlayingInfoCenter</code>. The&nbsp;<code style="font-size: 13px; font-family: Courier, Consolas, monospace; color: rgb(102, 102, 102); ">MPNowPlayingInfoCenter</code>&nbsp;class is part of the&nbsp;<code style="font-size: 13px; font-family: Courier, Consolas, monospace; color: rgb(102, 102, 102); ">MediaPlayer</code>framework, but works with all playback frameworks, including&nbsp;<code style="font-size: 13px; font-family: Courier, Consolas, monospace; color: rgb(102, 102, 102); ">MediaPlayer</code>,&nbsp;<code style="font-size: 13px; font-family: Courier, Consolas, monospace; color: rgb(102, 102, 102); ">AVFoundation</code>, and&nbsp;<code style="font-size: 13px; font-family: Courier, Consolas, monospace; color: rgb(102, 102, 102); ">AudioQueue</code>.</p><p style="margin-bottom: 0.833em; font-size: 100%; ">In addition to providing the usual song information strings, you should also pass in the playback rate, elapsed time, and media item duration. The playback device can use the duration and playback rate to create a progress bar. Update the elapsed time and&nbsp;<span style="font-size: 100%; ">playback rate whenever the playback rate changes.</span></p><div>看看效果，是不是比只是显示app的名字好多了。</div><div><br /></div><div><a href="http://iphone.ipsw.info/assets_c/2012/04/IMG_0865-150.html" onclick="window.open('http://iphone.ipsw.info/assets_c/2012/04/IMG_0865-150.html','popup','width=640,height=960,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://iphone.ipsw.info/assets_c/2012/04/IMG_0865-thumb-640x960-150.png" width="640" height="960" alt="IMG_0865.PNG" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></a></div></section><section><a name="//apple_ref/doc/uid/TP40011045-CH6-DontLinkElementID_6" title="Respond to Remote Events" style="color: rgb(51, 102, 204); text-decoration: none; "></a></section></span></span></div></span></span><p></p><p></p></div>

<div class="zemanta-pixie" style="margin-top:10px;height:15px"><a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"><img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=ce56630b-7f78-4e42-ae51-4a46f8af6b0a" alt="Enhanced by Zemanta" style="border:none;float:right" /></a></div>]]>
        
    </content>
</entry>

<entry>
    <title>[推荐]学习Core Audio</title>
    <link rel="alternate" type="text/html" href="http://iphone.ipsw.info/2012/04/core-audio.html" />
    <id>tag:iphone.ipsw.info,2012://3.398</id>

    <published>2012-04-24T01:37:48Z</published>
    <updated>2012-04-24T01:41:37Z</updated>

    <summary>Audio can affect the human brain in the most powerful and profound ways. Using Apple&apos;s Core Audio, you can leverage all that power in your own Mac and iOS software, implementing features ranging from audio capture to real-time effects, MP3...</summary>
    <author>
        <name>孔祥波</name>
        
    </author>
    
    
    <content type="html" xml:lang="zh-cn" xml:base="http://iphone.ipsw.info/">
        <![CDATA[<a href="http://iphone.ipsw.info/assets_c/2012/04/Learning Core Audio-147.html" onclick="window.open('http://iphone.ipsw.info/assets_c/2012/04/Learning Core Audio-147.html','popup','width=700,height=903,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://iphone.ipsw.info/assets_c/2012/04/Learning Core Audio-thumb-480x619-147.png" width="480" height="619" alt="Learning Core Audio.png" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></a><div><span style="color: rgb(0, 0, 0); font-family: verdana, arial, helvetica, sans-serif; font-size: small; ">Audio can affect the human brain in the most powerful and profound ways. Using Apple's Core Audio, you can leverage all that power in your own Mac and iOS software, implementing features ranging from audio capture to real-time effects, MP3 playback to virtual instruments, web radio to VoIP support. The most sophisticated audio programming system ever created, Core Audio is not simple. In&nbsp;</span><i style="color: rgb(0, 0, 0); font-family: verdana, arial, helvetica, sans-serif; font-size: small; "><b>Learning Core Audio</b></i><span style="color: rgb(0, 0, 0); font-family: verdana, arial, helvetica, sans-serif; font-size: small; ">, top Mac programming author Chris Adamson and legendary Core Audio expert Kevin Avila fully explain this challenging framework, enabling experienced Mac or iOS programmers to make the most of it. In plain language, Adamson and Avila explain what Core Audio can do, how it works, and how it builds on the natural phenomena of sound and the human language of audio. Next, using crystal-clear code examples, they guide you through recording, playback, format conversion, Audio Units, 3D audio MIDI connectivity, and overcoming unique challenges of Core Audio programming for iOS. Coverage includes: mastering Core Audio's surprising style and conventions; recording and playback with Audio Queue; synthesizing audio; perform effects on audio streams; capturing from the mic; mixing multiple streams; managing file streams; converting formats; creating 3D positional audio; using Core MIDI on the Mac; leveraging your Cocoa and Objective-C expertise in Core Audio's C-based environment, and much more. When you've mastered the "black arts" of Core Audio, you can do some serious magic. This book will transform you from an acolyte into a true Core Audio wizard.</span><br style="color: rgb(0, 0, 0); font-family: verdana, arial, helvetica, sans-serif; font-size: small; " /></div>]]>
        
    </content>
</entry>

<entry>
    <title>OS X 11E35  can&apos;t connect </title>
    <link rel="alternate" type="text/html" href="http://iphone.ipsw.info/2012/03/os-x-11e35-cant-connect.html" />
    <id>tag:iphone.ipsw.info,2012://3.397</id>

    <published>2012-03-31T03:35:30Z</published>
    <updated>2012-03-31T03:36:52Z</updated>

    <summary> [SSD-2:/var/log] yarshure% uname -aDarwin SSD-2.local 11.4.0 Darwin Kernel Version 11.4.0: Tue Mar 27 17:20:01 PDT 2012; root:xnu-1699.26.7~1/RELEASE_X86_64 x86_64Sat Mar 31 11:33:39 2012 : PPTP connecting to server &apos;mxxx.com&apos; (ipaddr)...Sat Mar 31 11:33:40 2012 : PPTP connection established.Sat Mar 31...</summary>
    <author>
        <name>孔祥波</name>
        
    </author>
    
    
    <content type="html" xml:lang="zh-cn" xml:base="http://iphone.ipsw.info/">
        <![CDATA[ <div><div>[SSD-2:/var/log] yarshure% uname -a</div><div>Darwin SSD-2.local 11.4.0 Darwin Kernel Version 11.4.0: Tue Mar 27 17:20:01 PDT 2012; root:xnu-1699.26.7~1/RELEASE_X86_64 x86_64</div></div><div><br /></div><div><br /></div><div><div>Sat Mar 31 11:33:39 2012 : PPTP connecting to server 'mxxx.com' (ipaddr)...</div><div>Sat Mar 31 11:33:40 2012 : PPTP connection established.</div><div>Sat Mar 31 11:33:40 2012 : PPTP set port-mapping for en0, interface: 4, protocol: 0, privatePort: 0</div><div>Sat Mar 31 11:33:40 2012 : Using interface ppp0</div><div>Sat Mar 31 11:33:40 2012 : Connect: ppp0 &lt;--&gt; socket[34:17]</div><div>Sat Mar 31 11:33:40 2012 : PPTP port-mapping for en0, interfaceIndex: 0, Protocol: None, Private Port: 0, Public Address: 0, Public Port: 0, TTL: 0.</div><div>Sat Mar 31 11:33:40 2012 : PPTP port-mapping for en0 inconsistent. is Connected: 1, Previous interface: 4, Current interface 0</div><div>Sat Mar 31 11:34:10 2012 : PPTP error when reading socket : EOF</div><div>Sat Mar 31 11:34:10 2012 : PPTP error when reading header : read -1, expected 12 bytes</div><div>Sat Mar 31 11:34:10 2012 : PPTP hangup</div><div>Sat Mar 31 11:34:10 2012 : Connection terminated.</div><div>Sat Mar 31 11:34:10 2012 : PPTP clearing port-mapping for en0</div><div>Sat Mar 31 11:34:10 2012 : PPTP disconnecting...</div><div>Sat Mar 31 11:34:10 2012 : PPTP disconnected</div></div>]]>
        
    </content>
</entry>

<entry>
    <title>iOSCon2012 会议讲稿</title>
    <link rel="alternate" type="text/html" href="http://iphone.ipsw.info/2012/03/ioscon2012.html" />
    <id>tag:iphone.ipsw.info,2012://3.396</id>

    <published>2012-03-26T00:41:52Z</published>
    <updated>2012-03-26T00:44:41Z</updated>

    <summary>Debuging Tech.pdf...</summary>
    <author>
        <name>孔祥波</name>
        
    </author>
    
    <category term="ioscon2012会议讲稿" label="iOSCon2012 会议讲稿" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://iphone.ipsw.info/">
        <![CDATA[<a href="http://iphone.ipsw.info/2012/03/26/Debuging%20Tech.pdf">Debuging Tech.pdf</a> <div><br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>new iPad 牛排</title>
    <link rel="alternate" type="text/html" href="http://iphone.ipsw.info/2012/03/new-ipad.html" />
    <id>tag:iphone.ipsw.info,2012://3.395</id>

    <published>2012-03-23T05:52:47Z</published>
    <updated>2012-03-23T06:50:19Z</updated>

    <summary><![CDATA[毫无疑问new iPad 内存是1GB，但是我们怎么获取这个数值呢？做iOS app开发的程序员，估计很少有人知道SYSCTL(8)我们看看SYSCTL(8)是干什么的？[SSD-2:~] yarshure% man sysctlsysctl -- get or set kernel state此处省略x 行HISTORY&nbsp; &nbsp; &nbsp;sysctl first appeared in 4.4BSD.BSD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; March 23, 2012 &nbsp; &nbsp; &nbsp;...]]></summary>
    <author>
        <name>孔祥波</name>
        
    </author>
    
        <category term="Coding" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="iOS" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="iPad" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="hardware" label="hardware" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="memory" label="memory" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="newipad" label="new iPad" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sysctl" label="sysctl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://iphone.ipsw.info/">
        <![CDATA[毫无疑问new iPad 内存是1GB，但是我们怎么获取这个数值呢？<div>做iOS app开发的程序员，估计很少有人知道SYSCTL(8)</div><div>我们看看SYSCTL(8)是干什么的？</div><div><br /></div><div><div>[SSD-2:~] yarshure% man sysctl</div></div><div>sysctl -- get or set kernel state</div><div>此处省略x 行</div><div><div>HISTORY</div><div>&nbsp; &nbsp; &nbsp;sysctl first appeared in 4.4BSD.</div><div><br /></div><div>BSD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; March 23, 2012 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BSD</div></div><div><br /></div><div>输出保函</div><div><div>[SSD-2:~] yarshure% sysctl -a | cut -d. -f1|sort -u</div><div>appleprofile</div><div>audit</div><div>debug</div><div>hw 这个我们比较关系，硬件参数</div><div>kern</div><div>machdep</div><div>net</div><div>security</div><div>user</div><div>vfs</div><div>vm</div></div><div><br /></div><div><!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->

<div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.machine = iPad3,1 这个大家都知道</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.model = J1AP 开发代号？</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.ncpu = 2 我是双核的</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.byteorder = 1234 CPU字节序</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.physmem = 1035976704&nbsp;真机内存&nbsp;1035976704/1024/1024=987M 近似1G</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.usermem = 907300864 用户态内存&nbsp;907300864/1024/1024 ＝&nbsp;865M 和上面差122M,这个是kernel 占用的？还是预留给GPU用的呢？</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.pagesize = 4096 &nbsp;page 大小</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.epoch = 1
</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.vectorunit = 0
</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.busfrequency = 250000000 238ZHz</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.cpufrequency = 1000000000 1GHz</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.cachelinesize = 32 &nbsp;不熟悉这</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.l1icachesize = 32768&nbsp;<span style="color: rgb(178, 34, 34); font-style: italic; ">Gives the size in bytes of the processor's cache lines.</span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.l1dcachesize = 32768 L1 cache size</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.l2settings = 1
</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.l2cachesize = 1048576 L2 cache size</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.tbfrequency = 24000000&nbsp;<span style="color: rgb(178, 34, 34); font-style: italic; ">This gives the time base frequency used by the OS and is the basis of all timing services.</span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.memsize = 1035976704 ==hw.physmem&nbsp;</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">hw.availcpu = 2 可使用的cpu数量</div></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; "><br /></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">完善输出可以下载下面的文件</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; "><a href="http://iphone.ipsw.info/2012/03/23/log.txt">log.txt</a></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; "><br /></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; ">xnu 代码关于sysctl 的一些说明</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: medium; "><a href="http://www.opensource.apple.com/source/xnu/xnu-792.13.8/libkern/libkern/sysctl.h">http://www.opensource.apple.com/source/xnu/xnu-792.13.8/libkern/libkern/sysctl.h</a></div><div><br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>从开发者角度看国内 Android Market 的用户体验</title>
    <link rel="alternate" type="text/html" href="http://iphone.ipsw.info/2012/02/dev-android-market.html" />
    <id>tag:iphone.ipsw.info,2012://3.394</id>

    <published>2012-02-23T08:40:11Z</published>
    <updated>2012-02-23T08:41:12Z</updated>

    <summary><![CDATA[转:http://www.dbanotes.net/review/China_Android_Market_UE.htmlby&nbsp;Fenng@dbanotes.net近一段时间在发布&nbsp;丁香园用药助手&nbsp;Android 版的过程中把国内几个重要的 Android Market 用了个遍，每次要发布新版本的时候都要感慨一下：几乎所有的 Android Market 后台的用户体验都不怎么好。信息各有一套国内所有的 Android Market 和 Google 官方 Android Market 都是不"兼容"的，无论是产品的描述信息以及应用类别划分，每一家都是自成一套。比如，软件截图，各有各自的要求，尺寸、格式如果不一致的话，还要针对性的单独人工处理，对开发者的工作量无形中增加了许多。对产品的描述也是千奇百怪，有的支持富文本编辑，有的只支持普通文本。有的更新软件要求写更新内容，有的则不提示填写，如果自己想写的话，需要修改整个 App 的描述信息。再比如分类信息，丁香园用药助手在有的 Market 上只能列入到「生活」类，而在另一个 Market 或许就要被迫列入「其他」，因为实在找不到和健康或是医疗相关的类目。版本控制问题只有少数一两家对版本控制还算有点意识，多数都没有相对靠谱的版本控制机制。有放任自流派：开发者在后台任意更新版本；也有关卡审核派：让你处于一个无法修改也无法撤销的"审核中"状态，一旦发现错误，想更正只能等下一个版本。至于审核周期，也是千奇百怪，有的立等可取，有的需要人工联系「我们发布了一个新版本，抽空给审核一下吧」，也有的长达一周。后台可访问性有的后台速度慢(这是很难让我想通的问题)，甚至应用截图都不能正常显示；而上传的接口，也有很多细节问题，比较离谱的是有几家居然不提示上传进度，整个上传过程中只能凭感觉，等待，刚好丁香园用药助手的软件包还比较大，有的时候遇到传输中断，简直令人抓狂。界面信息混乱第一次注册后提交软件的时候要把整个流程跑通还是比较难的，提示和术语都要理解半天才知道是怎么回事，文案差异性太大。登录到后台后，一个典型的情况是多数 Market 从后台找不到发布后的应用在前台的链接，比如应用汇。而有的 Market 更加离谱的是，后台还是传统的表格形式的展示，比如魅族。数据不够准确几乎所有的 Android 市场，统计信息都不是特别准确，有些甚至下载统计数天都不更新，有的甚至后台就不做数据统计，下载多少要前台页面自己去看。想得到靠谱的 Android 下载数据，哦，你实际上得不到靠谱的 Android 下载数据，如果想统计应用打开的数据，最好是早点启用类似友盟这样的应用统计服务。流程足够复杂流程复杂这个主要是针对联通、移动、联想这些富有官僚气息的 Market 来说的，比如用户资质信息最多的有上百条信息要填写，你就折腾吧，没有几个小时，没有公司上下配合(还要营业执照副本什么的)你根本搞不定，在你提交应用之前你准会崩溃。所以，有些时候，对这样的市场不得不放弃，即使有用户真的要从这些渠道下载你的应用，也没办法。结束语其实，倒也不只是国内的 Android 市场对开发者的用户体验差，Google 官方的菜市场也不咋地。每天在网上看到网友数落这个网站用户体验差，那个网站用户体验差什么的，其实如果你去用一下这些Android软件市场，就知道用户体验差其实是没有底线的。前几天参加移动开发者大会，发现 App Market 俨然已是各大互联网公司的标配，都在纷纷的推出自己的...]]></summary>
    <author>
        <name>孔祥波</name>
        
    </author>
    
    
    <content type="html" xml:lang="zh-cn" xml:base="http://iphone.ipsw.info/">
        <![CDATA[<p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">转:http://www.dbanotes.net/review/China_Android_Market_UE.html</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">by&nbsp;<a href="http://www.dbanotes.net/" target="_blank" style="color: rgb(17, 85, 204); ">Fenng</a>@<a href="http://www.dbanotes.net/" target="_blank" style="color: rgb(17, 85, 204); ">dbanotes.net</a></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">近一段时间在发布&nbsp;<a href="http://drugs.dxy.cn/android.htm" target="_blank" style="color: rgb(17, 85, 204); ">丁香园用药助手</a>&nbsp;Android 版的过程中把国内几个重要的 Android Market 用了个遍，每次要发布新版本的时候都要感慨一下：几乎所有的 Android Market 后台的用户体验都不怎么好。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><strong>信息各有一套</strong></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">国内所有的 Android Market 和 Google 官方 Android Market 都是不"兼容"的，无论是产品的描述信息以及应用类别划分，每一家都是自成一套。比如，软件截图，各有各自的要求，尺寸、格式如果不一致的话，还要针对性的单独人工处理，对开发者的工作量无形中增加了许多。对产品的描述也是千奇百怪，有的支持富文本编辑，有的只支持普通文本。有的更新软件要求写更新内容，有的则不提示填写，如果自己想写的话，需要修改整个 App 的描述信息。再比如分类信息，丁香园用药助手在有的 Market 上只能列入到「生活」类，而在另一个 Market 或许就要被迫列入「其他」，因为实在找不到和健康或是医疗相关的类目。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><strong>版本控制问题</strong></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">只有少数一两家对版本控制还算有点意识，多数都没有相对靠谱的版本控制机制。有放任自流派：开发者在后台任意更新版本；也有关卡审核派：让你处于一个无法修改也无法撤销的"审核中"状态，一旦发现错误，想更正只能等下一个版本。至于审核周期，也是千奇百怪，有的立等可取，有的需要人工联系「我们发布了一个新版本，抽空给审核一下吧」，也有的长达一周。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><strong>后台可访问性</strong></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">有的后台速度慢(这是很难让我想通的问题)，甚至应用截图都不能正常显示；而上传的接口，也有很多细节问题，比较离谱的是有几家居然不提示上传进度，整个上传过程中只能凭感觉，等待，刚好丁香园用药助手的软件包还比较大，有的时候遇到传输中断，简直令人抓狂。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><strong>界面信息混乱</strong></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">第一次注册后提交软件的时候要把整个流程跑通还是比较难的，提示和术语都要理解半天才知道是怎么回事，文案差异性太大。登录到后台后，一个典型的情况是多数 Market 从后台找不到发布后的应用在前台的链接，比如应用汇。而有的 Market 更加离谱的是，后台还是传统的表格形式的展示，比如魅族。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><strong>数据不够准确</strong></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">几乎所有的 Android 市场，统计信息都不是特别准确，有些甚至下载统计数天都不更新，有的甚至后台就不做数据统计，下载多少要前台页面自己去看。想得到靠谱的 Android 下载数据，哦，你实际上得不到靠谱的 Android 下载数据，如果想统计应用打开的数据，最好是早点启用类似<a href="http://www.umeng.com/" target="_blank" style="color: rgb(17, 85, 204); ">友盟</a>这样的应用统计服务。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><strong>流程足够复杂</strong></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">流程复杂这个主要是针对联通、移动、联想这些富有官僚气息的 Market 来说的，比如用户资质信息最多的有上百条信息要填写，你就折腾吧，没有几个小时，没有公司上下配合(还要营业执照副本什么的)你根本搞不定，在你提交应用之前你准会崩溃。所以，有些时候，对这样的市场不得不放弃，即使有用户真的要从这些渠道下载你的应用，也没办法。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><strong>结束语</strong></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">其实，倒也不只是国内的 Android 市场对开发者的用户体验差，Google 官方的菜市场也不咋地。每天在网上看到网友数落这个网站用户体验差，那个网站用户体验差什么的，其实如果你去用一下这些Android软件市场，就知道用户体验差其实是没有底线的。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">前几天参加移动开发者大会，发现 App Market 俨然已是各大互联网公司的标配，都在纷纷的推出自己的 Market ，恐怕以后还会更乱。据悉，已经有创业团队在开发一次性提交到多个 Market 的工具了，不知道什么时候能看到。很明显，这也是吃力不讨好的事儿。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">也可能是每家 Android Market 都在拼前台的用户体验呢吧，真心期待国内 Android Market 能早日关注一下针对开发者和维护者的用户体验问题，这也是每个 Android 开发者期待的，让开发者有更多精力做应该做的事情。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">--EOF--</p>]]>
        
    </content>
</entry>

<entry>
    <title>Instagram 架构分析笔记</title>
    <link rel="alternate" type="text/html" href="http://iphone.ipsw.info/2012/02/instagram.html" />
    <id>tag:iphone.ipsw.info,2012://3.393</id>

    <published>2012-02-23T07:45:12Z</published>
    <updated>2012-02-23T07:46:30Z</updated>

    <summary><![CDATA[转&nbsp;http://www.dbanotes.net/arch/instagram.htmlby&nbsp;Fenng@dbanotes.netInstagram&nbsp;团队上个月才迎来第 7 名员工，是的，7个人的团队。作为 iPhone 上最火爆的图片类工具，instagram 用户数量已经超过 1400 万，图片数量超过 1.5 亿张。不得不说，这真他妈是个业界奇迹。几天前，只有三个人的 Instagram 工程师团队发布了一篇文章：What Powers Instagram: Hundreds of Instances, Dozens of Technologies，披露了 Instagram 架构的一些信息，足够勾起大多数人的好奇心。读罢做点笔记，各种线索还是有一定参考价值的。能打开原文的建议直接读原文。Instagram 开发团队奉行的三个核心原则：Keep it very simple (极简主义)Don't re-invent the wheel (不重复发明轮子)Go with proven and solid technologies when you can(能用就用靠谱的技术)OS/主机操作系统的选择，在Amazon EC2上跑...]]></summary>
    <author>
        <name>孔祥波</name>
        
    </author>
    
    <category term="amazon" label="Amazon" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="centralprocessingunit" label="Central processing unit" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="cloudfront" label="CloudFront" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="instagram" label="Instagram" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="iphone" label="iPhone" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="pagerduty" label="PagerDuty" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="postgresql" label="PostgreSQL" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="redis" label="Redis" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://iphone.ipsw.info/">
        <![CDATA[<p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">转&nbsp;http://www.dbanotes.net/arch/instagram.html</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">by&nbsp;<a href="http://www.dbanotes.net/" target="_blank" style="color: rgb(17, 85, 204); ">Fenng</a>@<a href="http://www.dbanotes.net/" target="_blank" style="color: rgb(17, 85, 204); ">dbanotes.net</a></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><a href="http://instagr.am/" target="_blank" style="color: rgb(17, 85, 204); ">Instagram</a>&nbsp;团队上个月才迎来第 7 名员工，是的，7个人的团队。作为 iPhone 上最火爆的图片类工具，instagram 用户数量已经超过 1400 万，图片数量超过 1.5 亿张。不得不说，这真他妈是个业界奇迹。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">几天前，只有三个人的 Instagram 工程师团队发布了一篇文章：<a href="http://instagram-engineering.tumblr.com/post/13649370142/what-powers-instagram-hundreds-of-instances-dozens-of" target="_blank" style="color: rgb(17, 85, 204); ">What Powers Instagram: Hundreds of Instances, Dozens of Technologies</a>，披露了 Instagram 架构的一些信息，足够勾起大多数人的好奇心。读罢做点笔记，各种线索还是有一定参考价值的。能打开原文的建议直接读原文。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><img alt="Instragram.png" src="http://www.dbanotes.net/Images/Instragram.png" width="302" height="84" /></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">Instagram 开发团队<strong>奉行</strong>的三个核心原则：</p><ul style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><li>Keep it very simple (极简主义)</li><li>Don't re-invent the wheel (不重复发明轮子)</li><li>Go with proven and solid technologies when you can(能用就用靠谱的技术)</li></ul><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><strong>OS/主机</strong><br /></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">操作系统的选择，在Amazon EC2上跑 Ubuntu Linux 11.04 (Natty Narwhal) ，这个版本经过验证在 EC2 上够稳定。因为只有三名工程师，只有三名工程师，所以自己部署机器到 IDC 是不靠谱的事情。幸好有亚马逊。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><strong>负载均衡</strong><br /></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">此前曾用过两台 Nginx 做 DNS 轮询承载前端请求，这样做会有副作用，现在已经迁移到Amazon的ELB(Elastic Load Balancer)，起了三个 Nginx 实例，在 ELB 层停掉了 SSL , 以缓解 CPU 压力。DNS 服务使用 Amazon Route53 服务。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><strong>应用服务器</strong><br /></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">启用了 25 个 Django 实例，运行在 High-CPU Extra-Large 类型的服务器实例上，之所以用 High-CPU Extra-Large 实例是因为应用请求是 CPU 密集型而非 IO 密集型。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">使用&nbsp;<a href="http://gunicorn.org/" target="_blank" style="color: rgb(17, 85, 204); ">Gunicorn</a>&nbsp;作为 WSGI 服务器。过去曾用过 Apache 下的 mod_wsgi 模块，不过发现 Gunicorn 更容易配置并且节省 CPU 资源。使用&nbsp;<a href="http://fabric.readthedocs.org/en/1.3.3/index.html" target="_blank" style="color: rgb(17, 85, 204); ">Fabric</a>&nbsp;加速部署。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><strong>数据存储</strong></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">用户信息、图片元数据、标签等大部分数据存储在 PostgreSQL 中。主要的 Shard 数据库集群有 12个节点。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">实践中发现 Amazon 的网络磁盘系统单位时间内寻道能力不行，所以有必要将数据尽量放到内存中。创建了软 RAID 以提升 IO 能力，使用的&nbsp;<a href="http://en.wikipedia.org/wiki/Mdadm" target="_blank" style="color: rgb(17, 85, 204); ">Mdadm</a>&nbsp;工具进行 RAID 管理。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">管理内存中的数据，<a href="http://hoytech.com/vmtouch/vmtouch.c" target="_blank" style="color: rgb(17, 85, 204); ">vmtouch</a>&nbsp;这个小工具值得推荐。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">PostgreSQL 设置为 Master-Replica 方式，流复制模式。利用 EBS 的快照进行数据库备份。使用 XFS 文件系统，以便和快照服务充分配合。 使用&nbsp;<a href="https://github.com/greg2ndQuadrant/repmgr" target="_blank" style="color: rgb(17, 85, 204); ">repmgr</a>&nbsp;这个小工具做 PostgreSQL 复制管理器器。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">连接池管理，用了&nbsp;<a href="http://pgfoundry.org/projects/pgbouncer/" target="_blank" style="color: rgb(17, 85, 204); ">Pgbouncer</a>。<a href="http://thebuild.com/blog/" target="_blank" style="color: rgb(17, 85, 204); ">Christophe Pettus</a>&nbsp;的文章包含了不少&nbsp;<a href="http://thebuild.com/blog/" target="_blank" style="color: rgb(17, 85, 204); ">PostgreSQL</a>&nbsp;数据库的信息。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">TB 级别的海量图片存储在 Amazon S3 上，CDN 采用的也是 Amazon 的服务，CloudFront。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">Instagram 也是 Redis 的重度用户，Feed 以及 Session 信息都用 Redis 处理，Redis 也是以 Master-Replica 方式部署。在 Replica 节点上进行数据备份。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">使用了 Apache Solr 承担 Geo-search API 的工作，Solr 简单的 JSON 接口也不错。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">缓存使用了 6 个 Memcached 实例，库使用 pylibmc 和 libmemcached。亚马逊也提供缓存服务－Elastic Cache service ，Instagram 也有尝试，不过不便宜。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><strong>任务队列/发布通知</strong></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">队列服务使用&nbsp;<a href="http://gearman.org/" target="_blank" style="color: rgb(17, 85, 204); ">Gearman</a>&nbsp;，通知系统则使用<a href="https://github.com/samuraisam/pyapns" target="_blank" style="color: rgb(17, 85, 204); ">&nbsp;pyapns</a>&nbsp;来实现。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><strong>监控</strong></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">前面提及的服务器实例数量加起来，的确有100多个，有效的监控是相当有必要的。使用 Munin 作为主要监控工具 , 也写了不少定制插件，外部监控用&nbsp;<a href="http://pingdom.com/" target="_blank" style="color: rgb(17, 85, 204); ">Pingdom</a>&nbsp;的服务。通知服务使用&nbsp;<a href="http://www.pagerduty.com/" target="_blank" style="color: rgb(17, 85, 204); ">PagerDuty</a>。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">对于 Python 的错误报告，使用 Disqus 团队开源的&nbsp;<a href="http://pypi.python.org/pypi/django-sentry" target="_blank" style="color: rgb(17, 85, 204); ">Sentry</a>&nbsp;来处理。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "><strong>几个感想</strong></p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">0）轻装上阵说起来容易，做起来非常难。这也是 Instagram 团队目前最令人着迷的地方；</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">1）Python 社区已经足够成熟，各个环节上都已经有不错的解决方案了。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">2）如果要问我最大的一个感慨，我要说：<strong>Amazon 真是一家伟大的公司，甚至比 Google 还伟大</strong>。</p><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; ">--EOF--</p><div><br /></div><p style="color: rgb(0, 0, 0); font-family: arial, sans-serif; font-size: 13px; "></p> 

<div class="zemanta-pixie" style="margin-top:10px;height:15px"><a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"><img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=66f0c511-3ae1-45cb-81bf-dfa78c13c1c0" alt="Enhanced by Zemanta" style="border:none;float:right" /></a></div>]]>
        
    </content>
</entry>

<entry>
    <title>NSString 和hex code 互转</title>
    <link rel="alternate" type="text/html" href="http://iphone.ipsw.info/2012/02/nsstring-hex-code.html" />
    <id>tag:iphone.ipsw.info,2012://3.392</id>

    <published>2012-02-13T09:15:04Z</published>
    <updated>2012-02-14T09:35:54Z</updated>

    <summary><![CDATA[NSString *artist=@"王杰"; NSString *song=@"什么时候才能够";转换后Artist=8B737067&amp;Title=C04E484EF66519504D62FD801F59算法-(NSString*)toUnichar:(NSString*)src { &nbsp; &nbsp; NSMutableString *arX=[NSMutableString string]; &nbsp; &nbsp; for (int i = 0 ; i&lt;[src length]; i++) { &nbsp; &nbsp; &nbsp; &nbsp; unichar ch= [src characterAtIndex:i]; &nbsp; &nbsp; &nbsp; &nbsp; unichar b = ((((unsigned long)(ch) &amp;...]]></summary>
    <author>
        <name>孔祥波</name>
        
    </author>
    
        <category term="Coding" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="nsstring" label="NSString" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="objectivec" label="Objective-C" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sevenstring" label="Seven String" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="string" label="String" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="unicode" label="Unicode" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="utf8" label="UTF8" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://iphone.ipsw.info/">
        <![CDATA[<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo"><span style="color: #743aa7">NSString</span> *artist=<span style="color: #d22723">@"</span><span style="font: 18.0px 'Heiti SC Light'; color: #d22723">王杰</span><span style="color: #d22723">"</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; min-height: 21.0px"><span style="color: #743aa7">NSString</span> *song=<span style="color: #d22723">@"</span><span style="font: 18.0px 'Heiti SC Light'; color: #d22723">什么时候才能够</span><span style="color: #d22723">"</span>;</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; min-height: 21.0px"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; min-height: 21.0px">转换后</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; min-height: 21.0px"></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><b>Artist=8B737067&amp;Title=C04E484EF66519504D62FD801F59</b></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><b>算法</b></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><b></b></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo"><b>-(<span style="color: #743aa7">NSString</span>*)toUnichar:(<span style="color: #743aa7">NSString</span>*)src</b></p><b>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #743aa7"><span style="color: #000000">&nbsp; &nbsp; </span>NSMutableString<span style="color: #000000"> *arX=[</span>NSMutableString<span style="color: #000000"> </span><span style="color: #411a7f">string</span><span style="color: #000000">];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; <span style="color: #bd23a0">for</span> (<span style="color: #bd23a0">int</span> i = <span style="color: #3724d4">0</span> ; i&lt;[src <span style="color: #411a7f">length</span>]; i++) {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #743aa7">unichar</span> ch= [src <span style="color: #411a7f">characterAtIndex</span>:i];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #743aa7">unichar</span> b = ((((<span style="color: #bd23a0">unsigned</span> <span style="color: #bd23a0">long</span>)(ch) &amp; <span style="color: #3724d4">0xff00</span>) &gt;&gt; <span style="color: #3724d4">8</span>) | (((<span style="color: #bd23a0">unsigned</span> <span style="color: #bd23a0">long</span>)(ch) &amp; <span style="color: #3724d4">0x00ff</span>) &lt;&lt; <span style="color: #3724d4">8</span>));</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; [arX <span style="color: #411a7f">appendFormat</span>:<span style="color: #d22723">@"%X"</span>,b];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; }</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; <span style="color: #bd23a0">return</span> arX;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">}</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">反转</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo"></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #d22723"><span style="color: #743aa7">NSString</span><span style="color: #000000"> *str=</span>@"32003000310032003C68B1838E7FF397504E27595659ED70E8954C6BF266A86350830A00ED70E8950F5CF48B92634C889C69"</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #d22723"></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Heiti SC Light'"><span style="font: 11.0px Menlo"><b>2012</b></span><b>格莱美音乐大奖热门歌曲推荐</b></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Heiti SC Light'"><b><br /></b></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Heiti SC Light'"><b>算法</b></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Heiti SC Light'"><b></b></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo"><b>-(<span style="color: #743aa7">NSString</span>*)toString:(<span style="color: #743aa7">NSString</span>*)uniStr</b></p><b>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #743aa7"><span style="color: #000000">&nbsp; &nbsp; </span>NSMutableString<span style="color: #000000"> *outStr = [</span>NSMutableString<span style="color: #000000"> </span><span style="color: #411a7f">string</span><span style="color: #000000">];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; <span style="color: #bd23a0">int</span> len=[uniStr <span style="color: #411a7f">length</span>]/<span style="color: #3724d4">4</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; <span style="color: #743aa7">unichar</span> *oux=<span style="color: #78482d">alloca</span>(len*<span style="color: #bd23a0">sizeof</span>(<span style="color: #743aa7">unichar</span>));</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; <span style="color: #743aa7">unichar</span> *p = oux;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; min-height: 21.0px">&nbsp; &nbsp;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; <span style="color: #bd23a0">for</span> (<span style="color: #bd23a0">int</span> i=<span style="color: #3724d4">0</span>; i&lt;[uniStr <span style="color: #411a7f">length</span>]/<span style="color: #3724d4">4</span>; i++) {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; min-height: 21.0px">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #743aa7">NSString</span> *str=[uniStr <span style="color: #411a7f">substringWithRange</span>:<span style="color: #411a7f">NSMakeRange</span>(i*<span style="color: #3724d4">4</span>, <span style="color: #3724d4">4</span>)];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; min-height: 21.0px">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #743aa7">unichar</span> a =<span style="color: #31595d">toInde</span>([str <span style="color: #411a7f">characterAtIndex</span>:<span style="color: #3724d4">0</span>]);<span style="color: #008517">//3 3c</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #743aa7">unichar</span> b =<span style="color: #31595d">toInde</span>([str <span style="color: #411a7f">characterAtIndex</span>:<span style="color: #3724d4">1</span>]);<span style="color: #008517">//2</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #743aa7">unichar</span> c =<span style="color: #31595d">toInde</span>([str <span style="color: #411a7f">characterAtIndex</span>:<span style="color: #3724d4">2</span>]) ;<span style="color: #008517">//0 68</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #743aa7">unichar</span> d =<span style="color: #31595d">toInde</span>([str <span style="color: #411a7f">characterAtIndex</span>:<span style="color: #3724d4">3</span>]);<span style="color: #008517">//0</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; min-height: 21.0px">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; min-height: 21.0px">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #743aa7">unichar</span> x = c*<span style="color: #3724d4">16</span>*<span style="color: #3724d4">16</span>*<span style="color: #3724d4">16</span>+d*<span style="color: #3724d4">16</span>*<span style="color: #3724d4">16</span>+ a*<span style="color: #3724d4">16</span>+b;<span style="color: #008517">//</span><span style="font: 18.0px 'Heiti SC Light'; color: #008517">十进制</span><span style="color: #008517"> 3c68-&gt;683c</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; min-height: 21.0px">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #78482d">memcpy</span>(p, &amp;x, <span style="color: #3724d4">2</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #411a7f">printf</span>(<span style="color: #d22723">"%c,%x"</span>,*p,x);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; p++;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; min-height: 21.0px">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; }</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #411a7f"><span style="color: #000000">&nbsp; &nbsp; </span><span style="color: #743aa7">NSString</span><span style="color: #000000"> *x=[[</span><span style="color: #743aa7">NSString</span><span style="color: #000000"> </span>alloc<span style="color: #000000">] </span>initWithCharacters<span style="color: #000000">:oux </span>length<span style="color: #000000">:len];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; min-height: 21.0px">&nbsp;&nbsp; &nbsp;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; <span style="color: #bd23a0">return</span> outStr;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo"><span style="color: #bd23a0">int</span> toInde(<span style="color: #743aa7">unichar</span> x)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; <span style="color: #bd23a0">int</span> i;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; min-height: 21.0px">&nbsp;&nbsp; &nbsp;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; <span style="color: #bd23a0">switch</span> (x) {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">case</span> <span style="color: #3724d4">48</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=<span style="color: #3724d4">0</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">case</span> <span style="color: #3724d4">49</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=<span style="color: #3724d4">1</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">case</span> <span style="color: #3724d4">50</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=<span style="color: #3724d4">2</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">case</span> <span style="color: #3724d4">51</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=<span style="color: #3724d4">3</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">case</span> <span style="color: #3724d4">52</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=<span style="color: #3724d4">4</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">case</span> <span style="color: #3724d4">53</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=<span style="color: #3724d4">5</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">case</span> <span style="color: #3724d4">54</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=<span style="color: #3724d4">6</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">case</span> <span style="color: #3724d4">55</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=<span style="color: #3724d4">7</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">case</span> <span style="color: #3724d4">56</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=<span style="color: #3724d4">8</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">case</span> <span style="color: #3724d4">57</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=<span style="color: #3724d4">9</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">case</span> <span style="color: #3724d4">65</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=<span style="color: #3724d4">10</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">case</span> <span style="color: #3724d4">66</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=<span style="color: #3724d4">11</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">case</span> <span style="color: #3724d4">67</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=<span style="color: #3724d4">12</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">case</span> <span style="color: #3724d4">68</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=<span style="color: #3724d4">13</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">case</span> <span style="color: #3724d4">69</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=<span style="color: #3724d4">14</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">case</span> <span style="color: #3724d4">70</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i=<span style="color: #3724d4">15</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">default</span>:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #bd23a0">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; }</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; <span style="color: #bd23a0">return</span>&nbsp; i;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">}</p><div><br /></div></b></b><font class="Apple-style-span" face="Menlo" size="4"><br /></font><b><b><div>好久不写C，后面的的函数写的比较...</div><div><br /></div><div>再奉送一个将NSString 转换成UTF8 str</div><div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">-(<span style="color: #743aa7">NSString</span>*)toUtf8Char:(<span style="color: #743aa7">NSString</span>*)src</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; min-height: 21.0px">&nbsp;&nbsp; &nbsp;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #743aa7"><span style="color: #000000">&nbsp; &nbsp; </span>NSMutableString<span style="color: #000000"> *arX=[</span>NSMutableString<span style="color: #000000"> </span><span style="color: #411a7f">string</span><span style="color: #000000">];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #411a7f"><span style="color: #000000">&nbsp; &nbsp; </span><span style="color: #743aa7">NSData</span><span style="color: #000000"> *data=[src </span>dataUsingEncoding<span style="color: #000000">:</span>NSUTF8StringEncoding<span style="color: #000000">];</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; <span style="color: #bd23a0">const</span> <span style="color: #bd23a0">char</span> *p= [data <span style="color: #411a7f">bytes</span>];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; <span style="color: #bd23a0">for</span> (<span style="color: #bd23a0">int</span> i = <span style="color: #3724d4">0</span> ; i&lt;[data <span style="color: #411a7f">length</span>]; i++) {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #743aa7">Byte</span> ch = *p;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #411a7f">NSLog</span>(<span style="color: #d22723">@"%02X,%X"</span>,*p,ch);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; p++;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 18px/normal Menlo; "><font class="Apple-style-span" color="#000000"><br /></font></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; &nbsp; &nbsp; [arX <span style="color: #411a7f">appendFormat</span>:<span style="color: #d22723">@"%X"</span>,ch];</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; }</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">&nbsp; &nbsp; <span style="color: #bd23a0">return</span> arX;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo">}</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo"></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #d22723">@"<span style="font: 18.0px 'Heiti SC Light'">梁静茹</span><span style="font: 18.0px 'Heiti SC Light'">丝路</span>"转换后为</p><p></p></div></b></b>

<div class="zemanta-pixie" style="margin-top:10px;height:15px"><span class="Apple-style-span" style="font-family: arial; font-size: small; color: rgb(0, 0, 0); ">"<wbr>E6A281 E99D99 E88CB9E4B89DE8B7AF<wbr>"<span style="white-space: pre-wrap; ">	</span></span></div><div class="zemanta-pixie" style="margin-top:10px;height:15px"><font class="Apple-style-span" color="#000000" face="arial" size="2"><span class="Apple-style-span" style="white-space: pre-wrap;">顺便推荐一款内码查询器UnicodeChecker，官方网站 <a href="http://earthlingsoft.net">http://earthlingsoft.net</a><br /></span></font><span class="Apple-style-span" style="font-family: arial; font-size: small; color: rgb(0, 0, 0); "></span><a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"><img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=8ab0d93c-e8f1-48fb-8bfd-1d0a43644a48" alt="Enhanced by Zemanta" style="border:none;float:right" /></a></div>]]>
        
    </content>
</entry>

<entry>
    <title>about TableView in Mac OS X</title>
    <link rel="alternate" type="text/html" href="http://iphone.ipsw.info/2012/01/tableview-in-macosx.html" />
    <id>tag:iphone.ipsw.info,2012://3.391</id>

    <published>2012-01-18T06:37:06Z</published>
    <updated>2012-02-09T05:32:19Z</updated>

    <summary><![CDATA[问题来源 Mac OS X 直到Lion 才开始支持View base TableView&nbsp;那么如果应用程序要支持10.6-,是绝对不可以使用官方的API.那么要快速实现TableView Cell自定义非常复杂。可选方案: 1 IKImageBrowserView/IKImageBrowserCell 自定义显示比较麻烦，苹果就没想这个事情&nbsp; &nbsp; &nbsp;2&nbsp;NSCollectionView/NSCollectionViewItem 同上，自定义显示不够友好官方没有合适的，自己想偷懒，那么找一找，是不是有开源项目呢？1&nbsp;ColumnViewSample&nbsp;http://cocoawithlove.com/2010/03/custom-ui-bindings-in-interface-builder.html&nbsp;开发者Cocoa with Love 站长2&nbsp;PXListView &nbsp;https://github.com/Perspx/PXListView&nbsp;&nbsp;http://perspx.com/archives/making-list-views-really-fast/ 作者关于List view 的思考3 TwUI， Twitter on Mac&nbsp;https://github.com/twitter/twui&nbsp; 这个不介绍了，看github介绍吧4 others may be后续:TwUI 使用下来不错，但是实践中遇到TUITextField 输入框和中文输入法不兼容被迫创建多个TUINSView, 结构上感觉不是很干净，没办法，不想hack TwUI输入发兼容问题。...]]></summary>
    <author>
        <name>孔祥波</name>
        
    </author>
    
        <category term="Macintosh" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="tableview，mac" label="TableView，Mac" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://iphone.ipsw.info/">
        <![CDATA[问题来源 <a class="zem_slink" href="http://www.apple.com/macosx/" title="Mac OS X" rel="homepage">Mac OS X</a> 直到Lion 才开始支持View base TableView<div>&nbsp;那么如果应用程序要支持10.6-,是绝对不可以使用官方的API.那么要快速实现TableView Cell自定义非常复杂。</div><div><br /></div><div>可选方案: <span class="Apple-style-span" style="color: rgb(116, 58, 167); font-family: Menlo; font-size: 18px; ">1 IKImageBrowserView/</span><span class="Apple-style-span" style="color: rgb(116, 58, 167); font-family: Menlo; font-size: 18px; ">IKImageBrowserCell 自定义显示比较麻烦，苹果就没想这个事情</span></div><div><span class="Apple-style-span" style="color: rgb(116, 58, 167); font-family: Menlo; font-size: 18px; ">&nbsp; &nbsp; &nbsp;2&nbsp;</span>NSCollectionView/NSCollectionViewItem 同上，自定义显示不够友好</div><div><br /></div><div>官方没有合适的，自己想偷懒，那么找一找，是不是有开源项目呢？</div><div>1&nbsp;<span class="Apple-style-span" style="border-collapse: collapse; color: rgb(68, 68, 68); font-family: Helvetica, Arial, Sans; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><a href="http://projectswithlove.com/projects/ColumnViewSample.zip" style="color: rgb(34, 85, 170); ">ColumnViewSample</a>&nbsp;</span><a href="http://cocoawithlove.com/2010/03/custom-ui-bindings-in-interface-builder.html">http://cocoawithlove.com/2010/03/custom-ui-bindings-in-interface-builder.html</a>&nbsp;开发者Cocoa with Love 站长</div><div><br /></div><div>2&nbsp;PXListView &nbsp;<a href="https://github.com/Perspx/PXListView">https://github.com/Perspx/PXListView</a>&nbsp;&nbsp;http://perspx.com/archives/making-list-views-really-fast/ 作者关于List view 的思考</div><div>3 TwUI， <a class="zem_slink" href="http://twitter.com" title="Twitter" rel="homepage">Twitter</a> on Mac&nbsp;<a href="https://github.com/twitter/twui">https://github.com/twitter/twui</a>&nbsp; 这个不介绍了，看github介绍吧</div><div>4 others may be</div><div><br /></div><div>后续:</div><div>TwUI 使用下来不错，但是实践中遇到TUITextField 输入框和中文输入法不兼容</div><div>被迫创建多个TUINSView, 结构上感觉不是很干净，没办法，不想hack TwUI输入发兼容问题。</div><div><br /></div><div><br /></div>

]]>
        
    </content>
</entry>

<entry>
    <title>两个小时解决掉3个 BAD_ACCESS 的收获</title>
    <link rel="alternate" type="text/html" href="http://iphone.ipsw.info/2011/12/3-bad-access.html" />
    <id>tag:iphone.ipsw.info,2011://3.390</id>

    <published>2011-12-28T02:10:28Z</published>
    <updated>2011-12-28T02:12:38Z</updated>

    <summary><![CDATA[转一篇原文 http://www.xuzhe.com/?p=601首先，我说的是 iOS 开发，不是 Mac OS。其次，这次解决的三个 BAD_ACCESS 都是由于 iOS 程序在收到 Memory Warning 后，非当前 UIViewController 执行 viewDidUnload 后出现的问题。这类崩溃在真机上比较难测，因为是随机出现的，而且看 Crash Log 经常会看不出是哪行代码 BAD_ACCESS 了。所以这就需要善用模拟器提供的 "Hardware -&gt; Simulate Memory Warning" 功能了。同时为了能够方便的 Debug 出僵尸指针是谁，我在 Xcode 里加入以下三个环境变量：NSZombieEnabled NSAutoreleaseFreedObjectCheckEnabled NSDebugEnabledXcode 4 的话编辑一下 Scheme，加到 Environment Variables 里即可（如果以前没加过的话）。做完准备工作就能比较方便的进行...]]></summary>
    <author>
        <name>孔祥波</name>
        
    </author>
    
    
    <content type="html" xml:lang="zh-cn" xml:base="http://iphone.ipsw.info/">
        <![CDATA[<div>转一篇</div><div>原文 http://www.xuzhe.com/?p=601</div><div>首先，我说的是 iOS 开发，不是 Mac OS。</div><div><br /></div><div>其次，这次解决的三个 BAD_ACCESS 都是由于 iOS 程序在收到 Memory Warning 后，非当前 UIViewController 执行 viewDidUnload 后出现的问题。</div><div><br /></div><div>这类崩溃在真机上比较难测，因为是随机出现的，而且看 Crash Log 经常会看不出是哪行代码 BAD_ACCESS 了。所以这就需要善用模拟器提供的 "Hardware -&gt; Simulate Memory Warning" 功能了。</div><div><br /></div><div>同时为了能够方便的 Debug 出僵尸指针是谁，我在 Xcode 里加入以下三个环境变量：</div><div><br /></div><div>NSZombieEnabled NSAutoreleaseFreedObjectCheckEnabled NSDebugEnabled</div><div><br /></div><div>Xcode 4 的话编辑一下 Scheme，加到 Environment Variables 里即可（如果以前没加过的话）。</div><div><br /></div><div>做完准备工作就能比较方便的进行 Debug 了。可以每切换一次 UIViewController 就模拟一次内存警告，看会不会崩溃。</div><div><br /></div><div>接下来说说我这次遇到的三个问题。</div><div>1、一个低级错误</div><div><br /></div><div>由于我们有时会几个人同时改一个文件，结果就发生了A用完一个实例以后顺手给释放掉了，但是却把B写在 viewDidUnload 里的代码给留下了。自然也就过度释放了。</div><div><br /></div><div>这类过度释放的错误比较容易发现，只要改代码的时候稍微在原有文件里做一下搜索就能避免。</div><div><br /></div><div>2、关于 Interface Builder 里的实例生命周期有多长的问题。</div><div><br /></div><div>开发过 Mac OS 应用的同学都知道在开发 Mac 应用的时候，IB 里的实例 IBOutlet 到代码里是不用 retain 的。但是在 iOS 里却是要 retain 的。</div><div><br /></div><div>这有什么区别呢？</div><div><br /></div><div>如果你用的是 UIView 的话，的确，在 iOS 里不做 retain 也不要紧。因为 UIViewController 里的 UIView 本质上都是被 addSubview 到别的 UIView（UIWindow）里去的。但如果你在 IB 里放的是一个 NSObject，问题就出来了。</div><div><br /></div><div>这也就是我遇到的问题。iOS 会把这个 NSObject 释放掉！</div><div><br /></div><div>找这个问题花了我不少功夫，因为这个 NSObject 我只是在 IB 里连了连线，压根儿就没在代码里出现......解决方法其实很简单，在代码里加上</div><div><br /></div><div>@property (nonatomic, retain) NSObject *someObject;</div><div><br /></div><div>就好了（注意内存释放）。</div><div><br /></div><div>3、BCTabBarController 带来的噩梦</div><div><br /></div><div>在解决了以上问题后，整个程序仍然在满世界地不停的崩溃。这让我也很崩溃。咱好歹也算对 iOS 内存管理略有心得，搞个程序崩成这样实在是说不过去。</div><div><br /></div><div>继续找下去发现问题出在一个第三方的开源控件：BCTabBarController 上。</div><div><br /></div><div>用一个水准不高的第三方控件的结果就是给开发带来一定方便的同时，也带来了更多的麻烦（我不是在指责 BCTabBarController 的水准，因为要在苹果有限的公开 API 上完全自己来模拟原生 UITabBarController 的行为，的确是有难度的）。</div><div><br /></div><div>这次的问题出在 BC 调用其管理的 UIViewController 的 viewWillAppear: 函数时，忽略了该 UIViewController 可能已经 viewDidUnload 过了。一上来就直接调用 viewWillAppear: ，结果当然不是崩掉就是逻辑乱掉。</div><div><br /></div><div>解决方法是在 BC 调用 [viewController viewWillAppear:NO]; 之前加一句 [viewController view]; ，确保 viewDidLoad 先于 viewWillAppear: 被调用即可。</div><div><br /></div><div>注：loadView 和 viewDidLoad 都不应该自己直接去调用，用 [viewController view]; 这种方法来让 view 自行载入的好处是，如果 view 已经被载入了，这一步操作不会让所有 view 再被载入一次。</div><div><br /></div><div>现已发现的问题就是这么多，要在 iOS 上写个没有内存泄露又不会崩溃的程序实在是有难度。</div>]]>
        
    </content>
</entry>

<entry>
    <title>Mac 下查看某个App使用TCP 链接状况    </title>
    <link rel="alternate" type="text/html" href="http://iphone.ipsw.info/2011/12/mac-apptcp.html" />
    <id>tag:iphone.ipsw.info,2011://3.389</id>

    <published>2011-12-27T02:58:24Z</published>
    <updated>2011-12-27T02:59:26Z</updated>

    <summary><![CDATA[SSD:~ yarshure$ ps -ef|grep AirPlay|grep -v &nbsp;grep|awk '{print $2}'|xargs lsof -p |grep IPv4?\x9e? &nbsp;342 yarshure &nbsp; 16u &nbsp; &nbsp;IPv4 0xffffff8016b0c320 &nbsp; &nbsp; &nbsp; 0t0 &nbsp; &nbsp; &nbsp;TCP 192.168.69.56:49883-&gt;114.80.128.121:http (ESTABLISHED)?\x9e? &nbsp;342 yarshure &nbsp; 19u &nbsp; &nbsp;IPv4 0xffffff8020d9ec00 &nbsp; &nbsp; &nbsp; 0t0...]]></summary>
    <author>
        <name>孔祥波</name>
        
    </author>
    
    
    <content type="html" xml:lang="zh-cn" xml:base="http://iphone.ipsw.info/">
        <![CDATA[<div>SSD:~ yarshure$ ps -ef|grep AirPlay|grep -v &nbsp;grep|awk '{print $2}'|xargs lsof -p |grep IPv4</div><div>?\x9e? &nbsp;342 yarshure &nbsp; 16u &nbsp; &nbsp;IPv4 0xffffff8016b0c320 &nbsp; &nbsp; &nbsp; 0t0 &nbsp; &nbsp; &nbsp;TCP 192.168.69.56:49883-&gt;114.80.128.121:http (ESTABLISHED)</div><div>?\x9e? &nbsp;342 yarshure &nbsp; 19u &nbsp; &nbsp;IPv4 0xffffff8020d9ec00 &nbsp; &nbsp; &nbsp; 0t0 &nbsp; &nbsp; &nbsp;TCP 192.168.69.56:50005-&gt;58.215.45.192:http (ESTABLISHED)</div><div>?\x9e? &nbsp;342 yarshure &nbsp; 21u &nbsp; &nbsp;IPv4 0xffffff8020d9fa40 &nbsp; &nbsp; &nbsp; 0t0 &nbsp; &nbsp; &nbsp;TCP 192.168.69.56:49994-&gt;114.80.128.121:http (ESTABLISHED)</div><div>?\x9e? &nbsp;342 yarshure &nbsp; 23u &nbsp; &nbsp;IPv4 0xffffff8026da8de0 &nbsp; &nbsp; &nbsp; 0t0 &nbsp; &nbsp; &nbsp;TCP 192.168.69.56:50008-&gt;114.80.128.121:http (ESTABLISHED)</div><div>?\x9e? &nbsp;342 yarshure &nbsp; 24u &nbsp; &nbsp;IPv4 0xffffff8020da16c0 &nbsp; &nbsp; &nbsp; 0t0 &nbsp; &nbsp; &nbsp;TCP 192.168.69.56:50009-&gt;58.215.45.192:http (ESTABLISHED)</div>]]>
        
    </content>
</entry>

<entry>
    <title>飞乐音乐电台 精选版 先锋版(更新)</title>
    <link rel="alternate" type="text/html" href="http://iphone.ipsw.info/2011/12/airplay-release-beta.html" />
    <id>tag:iphone.ipsw.info,2011://3.388</id>

    <published>2011-12-02T15:33:33Z</published>
    <updated>2011-12-31T02:49:52Z</updated>

    <summary><![CDATA[下载飞乐音乐电台Mac OS X版 更新2011.12.31截图就不更新了，体验的赶紧下载尝鲜吧。AirPlay.zip&nbsp; 下载链接，点击前面的那个1 支持专辑和Artist 图片效果2 目前只用pre, pause,n 操作3 显示当前播的音乐专辑，演唱者，歌曲名字4 目前不支持切换电台，下周会实现&nbsp; &nbsp;可以手动切电台http://restful.airplayme.com/radios/selected.json&nbsp;查看电台id&nbsp; &nbsp;然后手动替换&nbsp;defaultstation.plist 文件中id 项目，重启即可2011.12.06 晚上版本下载地址：AirPlay.zip1 界面美化2 简单指出选电台2011.12.07 更新1 优化版本 胶片效果完善2 修改启动时不显示界面问题AirPlay.zip早期功能版本1 频道选择2 歌曲/艺人/专辑搜索3 歌词显示4 seek 功能下载地址&nbsp;AirPlayer_func_Ver.zip...]]></summary>
    <author>
        <name>孔祥波</name>
        
    </author>
    
        <category term="Coding" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="airplay" label="AirPlay" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="apple" label="Apple" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="puremac" label="Pure Mac" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="音乐电台" label="音乐电台" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="飞乐" label="飞乐" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://iphone.ipsw.info/">
        <![CDATA[<div><br /></div><div><br /></div><div><a href="http://iphone.ipsw.info/2011/12/31/AirPlay.zip">下载飞乐音乐电台Mac OS X版 更新2011.12.31</a></div><div><br /></div><div>截图就不更新了，体验的赶紧下载尝鲜吧。</div><div><br /></div><img alt="AirPlay.png" src="http://iphone.ipsw.info/2011/12/02/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202011-12-02%20%E4%B8%8B%E5%8D%8810.46.47.png" width="540" height="284" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /><div><strike><a href="http://iphone.ipsw.info/2011/12/02/AirPlay.zip">AirPlay.zip</a>&nbsp; 下载链接，点击前面的那个</strike></div><div>1 支持专辑和Artist 图片效果</div><div><strike>2 目前只用pre, pause,n 操作</strike></div><div>3 显示当前播的音乐专辑，演唱者，歌曲名字</div><div><strike>4 目前不支持切换电台，下周会实现</strike></div><div><strike>&nbsp; &nbsp;可以手动切电台<a href="http://restful.airplayme.com/radios/selected.json">http://restful.airplayme.com/radios/selected.json</a>&nbsp;查看电台id</strike></div><div><strike>&nbsp; &nbsp;然后手动替换&nbsp;defaultstation.plist 文件中id 项目，重启即可</strike></div><div><br /></div><div>2011.12.06 晚上版本</div><div><img alt="preview.png" src="http://iphone.ipsw.info/2011/12/06/preview.png" width="540" height="284" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></div><div><strike>下载地址：</strike></div><div><a href="http://iphone.ipsw.info/2011/12/06/AirPlay.zip"><strike>AirPlay.zip</strike></a></div><div><br /></div><div><br /></div><div>1 界面美化</div><div>2 简单指出选电台</div><div>2011.12.07 更新</div><div>1 优化版本 胶片效果完善</div><div>2 修改启动时不显示界面问题</div><div><a href="http://iphone.ipsw.info/2011/12/07/AirPlay.zip"><strike>AirPlay.zip</strike></a></div><div><br /></div><div><img alt="channel.png" src="http://iphone.ipsw.info/2011/12/07/channel.png" width="540" height="284" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></div><div><br /></div><div><br /></div><div>早期功能版本</div><div>1 频道选择</div><div>2 歌曲/艺人/专辑搜索</div><div>3 歌词显示</div><div>4 seek 功能</div><div><br /></div><div><img alt="airplay_func_ver.png" src="http://iphone.ipsw.info/2011/12/07/airplay_func_ver.png" width="948" height="461" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></div><div>下载地址&nbsp;<a href="http://iphone.ipsw.info/2011/12/07/AirPlayer_func_Ver.zip">AirPlayer_func_Ver.zip</a></div><div><br /></div><div><br /></div><div><br /></div>

<div class="zemanta-pixie" style="margin-top:10px;height:15px"><a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"><img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=4765dd01-2bad-4ab7-9b60-81e1c624a21b" alt="Enhanced by Zemanta" style="border:none;float:right" /></a></div>]]>
        
    </content>
</entry>

<entry>
    <title>无题 </title>
    <link rel="alternate" type="text/html" href="http://iphone.ipsw.info/2011/11/in-memory-of-my-mother.html" />
    <id>tag:iphone.ipsw.info,2011://3.387</id>

    <published>2011-11-22T13:46:42Z</published>
    <updated>2011-11-22T13:49:44Z</updated>

    <summary>晚上和哥哥姐姐在IM上聊了很多总想写很多事情，但是不知道如何写起。将来的某一天会下吧。...</summary>
    <author>
        <name>孔祥波</name>
        
    </author>
    
    
    <content type="html" xml:lang="zh-cn" xml:base="http://iphone.ipsw.info/">
        <![CDATA[晚上和哥哥姐姐在IM上聊了很多<div>总想写很多事情，但是不知道如何写起。</div><div><br /></div><div>将来的某一天会下吧。</div><div><br /></div>]]>
        
    </content>
</entry>

</feed>

