开发者

pathForResorce doesn't work with NSMutableArray

开发者 https://www.devze.com 2023-02-15 15:10 出处:网络
I have a jpg picture in my \"Other Sources\" folder, on xcode. Nice. But I\'m trying to add this image to my NSMutableArray.

I have a jpg picture in my "Other Sources" folder, on xcode. Nice. But I'm trying to add this image to my NSMutableArray.

[self.gallery addObject:[[NSBundle mainBundle] path开发者_如何学编程ForResource:@"001" ofType:@"jpg"]];

NSLog(@"%i", [self.gallery count]);

When I counts it, it returns 0.

What's happening?


either self.gallery is nil or there is no image 001.jpg in your bundle

0

精彩评论

暂无评论...
验证码 换一张
取 消