码迷,mamicode.com
首页 > 移动开发 > 详细

[ios]NSThread传值 NSValue传值

时间:2015-10-20 12:13:48      阅读:570      评论:0      收藏:0      [点我收藏+]

标签:

NSThread:http://www.cocoachina.com/bbs/read.php?tid=51873

NSValue:http://blog.sina.com.cn/s/blog_bf9843bf0101ehs1.html

 

//NSThread 属于 Foundation框架
-(void)startThread { MYClass c1(1,2,3); typedef struct _MyP { MYClass c1; int i; }MYP; MYP mp; pp.c1 = c1; pp.i = 10; //NSThread 传值 //NSValue 传值 [NSThread detachNewThreadSelector:@selector(FuncFrom:To:) toTarget:self withObject:[NSValue valueWithBytes:&mp objCType:@encode(MYP)]]; } -(void)FuncFrom:(MYClass)mc To:(int)value { .... }

 

[ios]NSThread传值 NSValue传值

标签:

原文地址:http://www.cnblogs.com/lyggqm/p/4894309.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!