首页 > 解决方案 > 更改“DraggableViewBackground.m”中的一些代码

问题描述

Github 源码地址:https ://github.com/cwRichardKim/RKSwipeCards

因此,我需要更改“DraggableViewBackground.m”中的一些代码。

而不是股票源代码上的文本数组,我需要创建一个图像数组......

库存部分:

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [super layoutSubviews];
        [self setupView];
        exampleCardLabels = [[NSArray alloc]initWithObjects:@"first",@"second",@"third",@"fourth",@"last", nil]; //%%% placeholder for card-specific information
        loadedCards = [[NSMutableArray alloc] init];
        allCards = [[NSMutableArray alloc] init];
        cardsLoadedIndex = 0;
        [self loadCards];
    }
    return self;
}

我查看了图像数组的各种实现,但仍然出现了一些我无法解决的错误。

这是我为数组编辑的代码:

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [super layoutSubviews];
        [self setupView];
        exampleCardGraphics = [[NSArray alloc]initWithObjects:00_quote@2x.png, 01_quote@2x.png,02_quote@2x.png,03_quote@2x.png,04_quote@2x.png,05_quote@2x.png,06_quote@2x.png,07_quote@2x.png,08_quote@2x.png,09_quote@2x.png,10_quote@2x.png,11_quote@2x.png,12_quote@2x.png,13_quote@2x.png,14_quote@2x.png,15_quote@2x.png,16_quote@2x.png,17_quote@2x.png,18_quote@2x.png,19_quote@2x.png,20_quote@2x.png,21_quote@2x.png,22_quote@2x.png,23_quote@2x.png,24_quote@2x.png,25_quote@2x.png,26_quote@2x.png,27_quote@2x.png,28_quote@2x.png,29_quote@2x.png,30_quote@2x.png,31_quote@2x.png,32_quote@2x.png,33_quote@2x.png,34_quote@2x.png,35_quote@2x.png,36_quote@2x.png,37_quote@2x.png,38_quote@2x.png,39_quote@2x.png,40_quote@2x.png,41_quote@2x.png,42_quote@2x.png,43_quote@2x.png,44_quote@2x.png,45_quote@2x.png,46_quote@2x.png,47_quote@2x.png,48_quote@2x.png,nil]; //%%% placeholder for card-specific information
        loadedCards = [[NSMutableArray alloc] init];
        allCards = [[NSMutableArray alloc] init];
        cardsLoadedIndex = 0;
        [self loadCards];
    }
    return self;
}

我收到“整数常量上的无效后缀 '_quote'”

我将如何解决此问题以将图像拉入阵列,然后为每张刷卡一张图像?

我已经更改了其他一些内容,但只有实例名称已在相应文件中相应更改,因此构建仍然成功,但我无法让图像数组工作。

请帮忙!

谢谢。

标签: arraysobjective-cimage

解决方案


推荐阅读