我正在使用tipku库coverflow,他们通过这种编码插入不同的图像,但我的问题是我不能使用这种静态方法,我需要用动态方法来替换它,以便可以在其中使用225张图像。
covers = [[NSMutableArray alloc] initWithObjects:[UIImage imageNamed:@"0.png"],[UIImage imageNamed:@"3.png"],nil];我试过了,但还是没有反应:
covers=[[NSMutableArray alloc]init];
for (int i = 0; i< 25; i++) {
NSString * imagestring =[NSString stringWithFormat:@"%d.png", i];
NSLog(@"%@ ", imagestring);
[covers addObject : imagestring];
[imagestring release];
}
[coverflow setNumberOfCovers:25];在使用它之后,我得到了这个错误
正在终止应用程序,原因是未捕获异常“”NSInvalidArgumentException“”,原因:“-NSCFString大小:无法识别的选择器已发送到实例0x577d0f0”“
有人能帮我吗?这样我就可以在我的代码中动态实现tapku库。或者可以修改我的代码,这样我就可以使用它了。提前谢谢。
发布于 2011-05-13 21:11:21
请遵守以下代码...
for (int i = 0; i< 25; i++) {
NSString * imagestring =[NSString stringWithFormat:@"%d.png", i];
NSLog(@"%@ ", imagestring);
[covers addObject : imagestring];
//[imagestring release];
I have commented this line as imageString is already autoreleased,
you dont own it so please do not relese it.
}@Toro说的是对的。
请使用调试器跟踪崩溃发生的位置。但是一定要做上面的更改。
谢谢,
https://stackoverflow.com/questions/5989703
复制相似问题