纠结求助,想买个廉价铭瑄主板win板

runtime|LOFTER(乐乎) - 记录生活,发现同好
LOFTER for ipad —— 记录生活,发现同好
下载移动端
关注最新消息
&nbsp&nbsp被喜欢
&nbsp&nbsp被喜欢
{list posts as post}
{if post.type==1 || post.type == 5}
{if !!post.title}${post.title|escape}{/if}
{if !!post.digest}${post.digest}{/if}
{if post.type==2}
{if post.type == 3}
{if !!post.image}
{if post.type == 4}
{if !!post.image}
{if !!photo.labels && photo.labels.length>0}
{var wrapwidth = photo.ow < 500?photo.ow:500}
{list photo.labels as labs}
{var lbtxtwidth = Math.floor(wrapwidth*(labs.ort==1?labs.x:(100-labs.x))/100)-62}
{if lbtxtwidth>12}
{if !!labs.icon}
{list photos as photo}
{if photo_index==0}{break}{/if}
品牌${make||'-'}
型号${model||'-'}
焦距${focalLength||'-'}
光圈${apertureValue||'-'}
快门速度${exposureTime||'-'}
ISO${isoSpeedRatings||'-'}
曝光补偿${exposureBiasValue||'-'}
镜头${lens||'-'}
{if data.msgRank == 1}{/if}
{if data.askSetting == 1}{/if}
{if defined('posts')&&posts.length>0}
{list posts as post}
{if post_index < 3}
{if post.type == 1 || post.type == 5}
{if !!post.title}${post.title|escape}{/if}
{if !!post.digest}${post.digest}{/if}
{if post.type == 2}
{if post.type == 3}
{if post.type == 4}
{if post.type == 6}
{if drlist.length>0}
更多相似达人:
{list drlist as dr}{if drlist.length === 3 && dr_index === 0}、{/if}{if drlist.length === 3 && dr_index === 1}、{/if}{if drlist.length === 2 && dr_index === 0}、{/if}{/list}
暂无相似达人,
{if defined('posts')&&posts.length>0}
{list posts as post}
{if post.type == 2}
{if post.type == 3}
{if post.type == 4}
{if post.type == 6}
this.p={ currentPage:1,pageNewMode:true,isgooglead3:false,ishotrecompost:false,visitorId:0, first:'',tag:'runtime',recommType:'new',recommenderRole:0,offset:20,type:0,isUserEditor:0,};objective-c中,有类别可以在不修改源码的基础上增加方法;近排在看别人的开源代码时,发现还可以动态增加属性。而且是在运行时,太牛B了。
使用运行时库,必须要先引入 objc/runtime.h
可以使用的函数如下:
OBJC_EXPORT&void&objc_setAssociatedObject(id&object,&const&void&*key,&id&value,&objc_AssociationPolicy&policy)
OBJC_EXPORT&id&objc_getAssociatedObject(id&object,&const&void&*key)__OSX_AVAILABLE_STARTING(__MAC_10_6,&__IPHONE_3_1);
兄弟们,看一个类别和动态添加属性的例子:
UILabel+Associate.h
#import &UIKit/UIKit.h&
@interface UILabel (Associate)
- (void) setFlashColor:(UIColor *) flashC
- (UIColor *) getFlashC
UILabel+Associate.m
#import "UILabel+Associate.h"
#import &objc/runtime.h&
@implementation UILabel (Associate)
static char flashColorK
- (void) setFlashColor:(UIColor *) flashColor{
objc_setAssociatedObject(self, &flashColorKey, flashColor, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
- (UIColor *) getFlashColor{
return objc_getAssociatedObject(self, &flashColorKey);
调用代码:
UILabel *lab = [[UILabel alloc] init];
[lab setFlashColor:[UIColor redColor]];
NSLog(@"%@", [lab getFlashColor]);
阅读(...) 评论()

我要回帖

更多关于 廉价平板 的文章

 

随机推荐