小编Abh*_*man的帖子

通过代码禁用RoundedRect类型的UIButton的用户交互

我想要为RoundedRect类型的UIButton禁用userinteraction.我试过了

[previousAudio userInteractionEnabled:NO];
Run Code Online (Sandbox Code Playgroud)

但由于未捕获异常而得到异常终止应用程序NSInvalidArgumentException,原因是:-[UIRoundedRectButton userInteractionEnabled:]:无法识别的选择器发送到实例

我该怎么做才能禁用用户交互?

谢谢.

objective-c uibutton ios

1
推荐指数
1
解决办法
6220
查看次数

目标Zip无法使用iOS5.1设备,未正确解压缩

我在项目中使用目标zip来解压缩并将文件存储到文档目录.它适用于iOS 5.0及更低版本.使用5.1模拟器正常工作.但是在使用5.1设备时,只有少量文件被解压缩.文件夹中没有显示任何其他内容.下面是用于解压缩和存储的代码.

for (NSString *file in fileArray) {

        // Get the file info/name, prepare the target name/path
        ZipReadStream *readStream = [unzipFile readCurrentFileInZip];
        FileInZipInfo *fileInfo = [unzipFile getCurrentFileInZipInfo];
        fileNameString = [NSString stringWithFormat:@"%@",[fileInfo name]];

        NSLog(@"fileNameString %@",fileNameString);

        NSString *DirName = [targetFolder stringByAppendingPathComponent:moduleName];
        NSLog(@"targetFolder %@",targetFolder);
        NSLog(@"DirName %@",DirName);

        NSLog(@"fileNameString %@",fileNameString);

        if (![fileManager fileExistsAtPath:DirName isDirectory:nil]) {
            [fileManager createDirectoryAtPath:DirName attributes:nil];
            NSLog(@"created directory %@", DirName);
        }

        NSLog(@"fileNameString %@",fileNameString);

        NSString *unzipFilePath = [DirName stringByAppendingPathComponent:fileNameString];

        NSLog(@"unzipFilePath-- %@",unzipFilePath);

        // Create a file handle for writing the unzipped file contents
        if (![fileManager …
Run Code Online (Sandbox Code Playgroud)

objective-c ios ios5

0
推荐指数
1
解决办法
787
查看次数

标签 统计

ios ×2

objective-c ×2

ios5 ×1

uibutton ×1