Tarena代码-一些代码碎片


retain

release

autorelease


alloc  new  copy

字典  数组  

[View addsubViewview];

set方法

-(void) setUIImageView:imageView;


class Test{

@(property) UIImageView* myImage;

}

UIImageView* _myImage;

-(UIImageView*) myImage {//get方法

return _myImage;

-(void) setMyImage:(UIImageView*)imageVIew {

//判断是否自负值

if(_myImage = imagerView )  return;//释放原有内存空间, 指针指向的原来的对象的 引用计数器-1

[_myImage release];

//拷贝地址

_myImage = imageView;

//给指针指向的新的对象的 引用计数器+1

[_myImage reatin]; 

}


void init{

_myImage = [UIImageView imageView]; //0

self.myImage  = [UIImageView imageView]; //1

self.myImage =  [[[UIImageView alloc]init ] autorelease]; //1

_myImage = [[UIImageView alloc]init ] ;//1

}


void test{

_myImage

}


#pragma mark --开启显示底部

- (void)viewWillAppear:(BOOL)animated

{[self.chatTableView setContentOffset:CGPointMake(CGFLOAT_MAX, CGFLOAT_MAX)];

}


- (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated


PayReq *request = [[PayReq alloc] init];

        request.openID=@"wxd930ea5d5a258f4f";

        request.partnerId = @"1900000109";//[resultDic objectForKey:@"partnerid"];

        request.prepayId= @"1101000000140429eb40476f8896f4c9";//[resultDic objectForKey:@"partnerid"];

        request.package = @"Sign=WXpay";

        request.nonceStr= @"139042a4157a773f209847829d80894d";//[resultDic objectForKey:@"noncestr"];

        NSString *timeStamp = [NSString stringWithFormat:@"%@", @"1398746574"];

        request.timeStamp = [timeStamp intValue];

        request.sign= @"7ffecb600d7157c5aa49810d2d8f28bc2811827b";//[resultDic objectForKey:@"sign"];

//        [WXApi safeSendReq:request];

        [WXApi sendReq:request];


PayReq *request = [[PayReq alloc] init];

        request.openID=@"wxd930ea5d5a258f4f";

        request.partnerId = @"1900000109";//[resultDic objectForKey:@"partnerid"];

        request.prepayId= @"1101000000140429eb40476f8896f4c9";//[resultDic objectForKey:@"partnerid"];

        request.package = @"Sign=WXpay";

        request.nonceStr= @"139042a4157a773f209847829d80894d";//[resultDic objectForKey:@"noncestr"];

        NSString *timeStamp = [NSString stringWithFormat:@"%@", @"1398746574"];

        request.timeStamp = [timeStamp intValue];

        request.sign= @"7ffecb600d7157c5aa49810d2d8f28bc2811827b";//[resultDic objectForKey:@"sign"];

//        [WXApi safeSendReq:request];

        [WXApi sendReq:request];


// ---  获取当前连接上得wifi信息  ---

- (id)getWiFiInfo

{

    NSArray *ifs = (__bridge id)CNCopySupportedInterfaces();

    id info = nil;

    

    for (NSString *ifnam in ifs) {

        info = (__bridge id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);

        

        if (info && [info count]) {

            break;

        }

    }

    return info;

}


  #import <SystemConfiguration/CaptiveNetwork.h>

}


//一个section刷新    
NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2];    
[tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];    
//一个cell刷新    
NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];    
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值