-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatom.xml
199 lines (135 loc) · 8.9 KB
/
atom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[Bryan's Blog]]></title>
<link href="http://kobe9009.github.io/atom.xml" rel="self"/>
<link href="http://kobe9009.github.io/"/>
<updated>2014-03-12T01:42:32+08:00</updated>
<id>http://kobe9009.github.io/</id>
<author>
<name><![CDATA[Bryan Wang]]></name>
<email><![CDATA[[email protected]]]></email>
</author>
<generator uri="http://octopress.org/">Octopress</generator>
<entry>
<title type="html"><![CDATA[关于iOS7.1对Viewcontroller layout的一个改动]]></title>
<link href="http://kobe9009.github.io/blog/2014/03/12/guan-yu-ios7-dot-1dui-viewcontroller-layoutde-%5B%3F%5D-ge-gai-dong/"/>
<updated>2014-03-12T01:33:33+08:00</updated>
<id>http://kobe9009.github.io/blog/2014/03/12/guan-yu-ios7-dot-1dui-viewcontroller-layoutde-[?]-ge-gai-dong</id>
<content type="html"><![CDATA[<h1>前言</h1>
<p>今天iOS7.1正式发布,更新完后突然发现我们的应用基本所有的页面都出现了UI的错位,立即着手寻找bug</p>
<h2>问题点</h2>
<p>寻找问题的过程这里不进行阐述了,直接通报结果,iOS7.1在页面布局中增加了一个逻辑,如果navigationBar的背景是不透明的,那么所有这个导航栏对应的UIViewController的View origin-X 会变成64,</p>
<p>如果导航栏背景有透明,那么还是全屏布局!</p>
<p><strong>吐槽:这样的改动没有出现在apple的API diff中!也没有出现在release note中!这是在坑爹!</strong></p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[深入了解@dynamic]]></title>
<link href="http://kobe9009.github.io/blog/2014/03/06/shen-ru-liao-jie-at-dynamic/"/>
<updated>2014-03-06T00:24:42+08:00</updated>
<id>http://kobe9009.github.io/blog/2014/03/06/shen-ru-liao-jie-at-dynamic</id>
<content type="html"><![CDATA[<h1>前言</h1>
<p> 最近在看一些牛x的开源库,看到了一个@dynamic用法,让自己深入的了解了下这个关键字,下面和大家分享一下</p>
<h2>思考问题</h2>
<p> 一个class的categroy能添加property么?</p>
<p> 这个问题可能不少人在面试的时候会遇到,这里我们先放下,分析完@dynamic后再来解答</p>
<h2>@dynamic用来做什么的?</h2>
<p> <strong>@dynamic</strong>和<strong>@synthesize</strong>是在class implementation时告诉编译器如何处理对应的property:</p>
<p> *@synthesize:会自动根据property的attribute生成对应的getter、setter,在class 的propertylist中加入这个property的信息,并且在class的 ivar list中加入了对应的成员变量,xcode4开始编译器会默认使用@synthesize对声明的property进行处理,并自动生成 _propertyName 这样的ivar</p>
<p> *@dynamic:和<strong>@synthesize</strong>完全相反,它告诉编译器不对这个property进行任何的操作,在IDE中我们可以正常对property进行访问,但是如果要在app运行时不会出问题,我们需要手动合成对应的getter和setter方法,可以是自己写,可以通过消息转发来动态实现</p>
<h2>说了这么多,来举个例子:</h2>
<pre><code>@interface NSObject (dynamic)
@property (nonatomic, strong) NSObject *object;
@end
static char propertyName;
@implementation NSObject (dynamic)
@dynamic object;
- (void)setObject:(NSObject *)object {
objc_setAssociatedObject(self, &propertyName, object, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (NSObject *)object {
return objc_getAssociatedObject(self, &propertyName);
}
@end
</code></pre>
<p> 这样是不是我们刚才思考的问题的答案已经很了然,这里的例子是手动合成方法给分类添加伪属性,因为这样的属性并不能通过class的property list中获取。</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[解决Octopress选装Greyshade主题Disqus失效的问题--深入了解jekyll模板]]></title>
<link href="http://kobe9009.github.io/blog/2014/03/01/problem-with-greyshade/"/>
<updated>2014-03-01T23:03:05+08:00</updated>
<id>http://kobe9009.github.io/blog/2014/03/01/problem-with-greyshade</id>
<content type="html"><![CDATA[<h2>问题描述</h2>
<p>在寻找漂亮的Octopress主题的时候,发现了一个不错的theme – <a href="https://github.com/shashankmehta/greyshade" title="Github地址">Greyshade</a>,按照Github页面上的提示进行安装:</p>
<pre><code>$ git clone [email protected]:shashankmehta/greyshade.git .themes/greyshade
$ echo "\$greyshade: color;" >> sass/custom/_colors.scss //Substitue 'color' with your highlight color
$ rake "install[greyshade]"
$ rake generate
</code></pre>
<p>preview了下,发现Disqus的comment功能不见了,下面开始解决问题。</p>
<h2>Jekyll模板结构</h2>
<p>下面的内容是我对Jekyll结构的理解,当我们新建一个模板,下面主要有下面几个文件和目录:</p>
<pre><code>_config.yml
</code></pre>
<p>全局的配置文件,可以控制一些plugin的开关,比如Disqus,github,google+等</p>
<pre><code>sass/
</code></pre>
<p>里面是一堆的scss文件,负责页面UI区域规划,显示的颜色,文字排版等</p>
<pre><code>source/
</code></pre>
<p>出去sass干的,剩下的比如页面内容的组织,逻辑等就是由这个控制</p>
<pre><code>source/_posts
</code></pre>
<p>其中这个文件夹存放的就是blog的source,blog的内容在这里面用编辑器编辑即可。</p>
<h2>解决Disqus无法工作的问题</h2>
<p>首先查看了问题页面的源码,负责comment模块的代码如下</p>
<pre><code><section id="comment">
<h1 class="title">Comments</h1>
<div id="disqus_thread" aria-live="polite"><noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
</section>
</code></pre>
<p>这里没有执行任何的逻辑调用,查看了下这段代码位于/<em>includes/post/disqus_thread.html中,而真正的需要的代码位于/</em>includes/disqus.html中,这样问题就看disqus原来在哪里调用即可
查看完,发现原来的classic theme是把disqus调用放在after_footer.html中,这个在新主题内没有被任何文件调用,查看文件修改记录,在_layouts/default.html中line 19加入代码</p>
<script type="text/javascript">
var disqus_shortname = 'bryanwong';
// var disqus_developer = 1;
var disqus_identifier = 'http://kobe9009.github.io/blog/2014/03/01/problem-with-greyshade/';
var disqus_url = 'http://kobe9009.github.io/blog/2014/03/01/problem-with-greyshade/';
var disqus_script = 'embed.js';
(function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/' + disqus_script;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}());
</script>
<p> <script type="text/javascript"></p>
<pre><code>(function(){
var twitterWidgets = document.createElement('script');
twitterWidgets.type = 'text/javascript';
twitterWidgets.async = true;
twitterWidgets.src = '//platform.twitter.com/widgets.js';
document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
})();
</code></pre>
<p> </script></p>
<p>问题解决</p>
<p>PS:解决这个问题也让自己进一步熟悉了页面组织结构,后面有时间可以尝试调出自己风格的页面出来</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[开篇]]></title>
<link href="http://kobe9009.github.io/blog/2014/02/26/first-post/"/>
<updated>2014-02-26T15:14:16+08:00</updated>
<id>http://kobe9009.github.io/blog/2014/02/26/first-post</id>
<content type="html"><![CDATA[<h2>折腾Octopress</h2>
<p>折腾了许久的Blog终于上线了,参考的无数的文章,但是这里要重点推荐这篇—<a href="http://williamherry.com/blog/2012/07/20/octopress-setup/">《Octopress – 像黑客一样写博客》</a>,很清晰的介绍了Octopress的工作模式,以及多电脑的部署。</p>
<p>主要困惑点在于—两个看似相同的git仓库嵌套着工作,理解其中原理后,一切就很清晰和简单。</p>
<p>后期的工作就是写写blog,修改修改UI,<strong>没有美感的程序猿怎么去做客户端!</strong></p>
<h2>写在转行两年</h2>
<p>转眼发现自己已经转行两年,由一个三年的<strong>Sales</strong>突然变身成一个<strong>iOS程序猿</strong>确实跨度有些大。</p>
<p>但是既然现在身为一个程序猿,那么有必要开始对自己的一些知识点做个总结,对一些技巧做一些分享,对一些问题做一些讨论,所以建下这个blog,希望对自己对同行们都有一些帮助</p>
]]></content>
</entry>
</feed>