繁体   English   中英

从应用程序商店下载应用程序时无法从iPad IOS 10.2.1 64bit的xcode项目中读取图像(testflight)

[英]Unable to read Images from xcode project in iPad IOS 10.2.1 64bit when download app from app store (testflight)

例如,无法从xcode项目读取图像。 将一张图片拖放到xcode项目中,然后使用以下代码阅读。

__weak NSString * strTemp = [NSString stringWithFormat:@“%@ / s _%@”,[[NSBundle mainBundle] resourcePath],[[self.arr_gallery objectAtIndex:i] valueForKey:@“ filename_larger”]];

            strTemp = [strTemp substringToIndex:[strTemp length]-3];

            strTemp = [NSString stringWithFormat:@"%@png",strTemp];

// // NSString * strTemp = [[NSString alloc] initWithFormat:@“%@ / s_BGP001@2x.png”,[[NSBundle mainBundle] resourcePath]];

            UIImage *image;

            image = [[UIImage alloc] initWithContentsOfFile:strTemp];

            img.image = image;

            strTemp = nil;

编写以下代码。

 NSString *newStrTemp = [strTemp stringByReplacingOccurrencesOfString:@"jpg" withString:@"png"];    

而不是这个。

strTemp = [strTemp substringToIndex:[strTemp length]-3];
strTemp = [NSString stringWithFormat:@"%@png",strTemp];

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM