Xcode注意事项

1.ScrollView

必需调用setContentSize设置大小,并且ContentSize > Frame,才能出现滚动效果

[self.topMenuScrollView setContentSize:CGSizeMake(1118, 60)];


2.添加html5文件

可以将html文件添加成为 Relative to Group

将html调用的xml 和 images 添加成为Relative to Folder Reference

特别注意:pano2vr_player.js 添加后默认会加入 Complie Sources,需要把它移动到Copy bundle Resources


3.duplicate symbols for architecture i386

注意是否在不同的文件中实现了相同名字的类


4.Objective-C 字符串与数值互相转换  

Convert NSString to int

1NSString *aNumberString = @"123";
2int i = [aNumberString intValue];

 

Convert int to NSString

1int aNumber = 123;
2NSString *aString = [NSString stringWithFormat:@"%d", aNumber];


5.单个文件的编译选项,

-fobjc-arc              开启arc
-fno-objc-arc        不开启arc

6.定时器
NSTimer *countTimer;
countTimer= [NSTimer scheduledTimerWithTimeInterval:0.8 target:self selector: @selector(changeAlpha) userInfo:nil repeats:YES];

- (void)changeAlpha{
    UIView *temp;
    
    for(temp in self.view.subviews) {
        if(![temp isKindOfClass:[UIImageView class]] &&
           ![temp isKindOfClass:[UILabel class]])
        {
            continue;
        }
        
        if (temp.alpha == 1){
            [UIView animateWithDuration:0.8 animations:^(void){
                [temp setAlpha:0.5];
            }];
        }
        else{
            [UIView animateWithDuration:0.8 animations:^(void){
                [temp setAlpha:1];
            }];
        }
        [UIView commitAnimations];
    }
}

7.设置imageView透明度反复变化

[UIView animateWithDuration:0.6 delay:0 options:UIViewAnimationOptionAutoreverse|UIViewAnimationOptionRepeat animations:^(void){
        UIView *temp;
        for(temp in self.view.subviews) {
            if([temp isKindOfClass:[UIImageView class]])
            {
                temp.alpha = 0.5;
            }
        }
    }completion:^(BOOL finished){
        //        [self star]
    }];

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值