图像UIVIEW的旋转

2 在UIImageView 中旋转图像

        float rotateAngle = M_PI;
        CGAffineTransform transform =CGAffineTransformMakeRotation(rotateAngle);
        imageView.transform = transform;
       

        以上代码旋转imageView, 角度为rotateAngle, 方向可以自己测试哦!


4 读取plist文件并转化为NSDictionary

        NSString *documentsPath = [self getDocumentsDirectory];
        NSString *fullPath = [documentsPath stringByAppendingPathComponent:@"save.plist"];
        NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:fullPath];


5 读取一般性文档文件

        NSString *tmp;
        NSArray *lines;
 /*将文件转化为一行一行的*/
        lines = [[NSString    stringWithContentsOfFile:@"testFileReadLines.txt"] 
                       componentsSeparatedByString:@"\n"];
    
         NSEnumerator *nse = [lines objectEnumerator];
    
         // 读取<>里的内容
         while(tmp = [nse nextObject]) {
                  NSString *stringBetweenBrackets = nil;
                  NSScanner *scanner = [NSScanner scannerWithString:tmp];
                  [scanner scanUpToString:@"<" intoString:nil];
                  [scanner scanString:@"<" intoString:nil];
                  [scanner scanUpToString:@">" intoString:&stringBetweenBrackets];

                  NSLog([stringBetweenBrackets description]);
          }


对于读写文件,还有补充,暂时到此。随机数和文件读写在游戏开发中经常用到。所以把部分内容放在这,以便和大家分享,也当记录,便于查找。


6 隐藏NavigationBar
[self.navigationController setNavigationBarHidden:YES animated:YES];

在想隐藏的ViewController中使用就可以了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值