- 浏览: 26715 次
- 性别:
- 来自: 扬州
最新评论
-
caoyudong:
newjyang 写道newjyang 写道哈哈哈呵呵呵呵笑个 ...
iOS 多线程开发以及网络图片加载 -
newjyang:
newjyang 写道哈哈哈呵呵呵呵笑个毛!
iOS 多线程开发以及网络图片加载 -
newjyang:
哈哈哈呵呵呵呵
iOS 多线程开发以及网络图片加载 -
newjyang:
aaaaa
iOS 多线程开发以及网络图片加载 -
newjyang:
test
iOS 多线程开发以及网络图片加载
文章列表
NSMutableString *goodListString=[[NSMutableString alloc]init];//初始化可变字符串
for (int i=0; i<m_goodsInfo.count; i++) {
[goodListString insertString:m_goodsInfo[i] atIndex:[goodListString length]];
}
randomGenerate=[[NSMutableArray alloc]init];
do{
int random=arc4random()% ...
将n个CGPoint放到数组:
NSValue *val=[NSValue valueWithCGPoint:CGPointMake(20+i*xunit, 520-([lisData[i] doubleValue]-beginPrice)/unit)];
[stockMin addObject:val];
将数组遍历:
for (int i=1; i<stockMin.count;i++)
{
NSValue *val=[stockMin objectAtIndex:i];
CGPoint addPoint=[val CGPoin ...
(void)setupRightBarButon{
UIBarButtonItem *btnSave = [[UIBarButtonItem alloc]
initWithTitle:@"图片浏览"
style:UIBarButtonItemStylePlain
target:self
action:@selecto ...
NSDictionary *group=[[NSDictionary alloc]initWithObjectsAndKeys:indexPath,@"indexpath",cell,@"cell", nil];
[NSThread detachNewThreadSelector:@selector(loadLabelTableView:) toTarget:self withObject:group];
-(void)loadLabelTableView:(NSDictionary *)group
{
UILabel *label=[[ ...
[self.view bringSubviewToFront: tablevew];
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
NSString *bodyUnicode = [webview stringByEvaluatingJavaScriptFromString:@"document.body.innerText"];
NSString *bodyUtf=[self replaceUnicode:bodyUnicode];
NSLog(@"%@",@"加载结束");
if (flag==0)
{
...
-(NSURLRequest *)readUrlData
{
NSURL *url = [[NSURL alloc]initWithString:stringUrl];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
return request;
}
-(void)readData
{
ReadUrlData *readUrlData=[[ReadUrlData alloc]init:@"http://smartbox.gtimg.cn/s3/?q=600&t= ...
- (void)setupLeftMenuButton
{
MMDrawerBarButtonItem * leftDrawerButton = [[MMDrawerBarButtonItem alloc] initWithTarget:self action:@selector(leftDrawerButtonPress:)];
[self.navigationItem setLeftBarButtonItem:leftDrawerButton];
}
- (void)leftDrawerButtonPressid)sender
{
[self.mm_drawerCo ...
-(EGORefreshTableHeaderView *)refresh//先初始化
{
EGORefreshTableHeaderView *egoView=[[EGORefreshTableHeaderView alloc] initWithFrame:CGRectMake(0.0f, 0.0f - self.view.bounds.size.height, self.view.frame.size.width, self.view.bounds.size.height)];
egoView.delegate=self;
[egoView refreshLastUp ...
例子:
-(Goods *)getGoodsNSString *)barcodeNSArray *)goodsInfo
{
Goods *goodObject;//声明一个goos类
for(Goods *goods in goodsInfo )
{
if([barcode isEqualToString:goods.barcode])
goodObject=[[Goods alloc]init:barcode :goods.name :goods.unit :goods.price :goods.num];
}
return g ...
IndexViewController *viewController=[[IndexViewController alloc]init];//中间的一个类
MenuViewController *menuViewController=[[MenuViewController alloc]init];//左边的一个类
UINavigationController * navigationController = [[UINavigationController alloc]initWithRootViewController:viewController];
MMDraw ...
首先在AppDelegate.m中 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 方法中初始话本地文件:NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString *path=[paths objectAtIndex:0];
NSLog(@"%@" ...
[[NSNotificationCenter defaultCenter]postNotificationName:@"people" object:[self.listdata objectAtIndex:indexPath.row]]//给要传的值写个名字如:@“people”
接收: [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(showvalue1:) name:@"people" object:nil];//需要一个showvalue1:方 ...
首先在在AppDelegate.m里的:(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions方法中加入ViewController *viewcontroller=[ViewController new];
UINavigationController *uinavigationcontroller=[[UINavigationController alloc]initWithRootViewController:viewcont ...