apple beginner here. 저는 현재 nickLockwood가 iCarousel을 공부하고 시도하고 있습니다. Im iCarousel에 이미지를 넣을 계획입니다. 그래서 여기 내하는 .m 및 .H 코드는 다음과 같습니다iCarousel 가져 오기 이미지에 어려움이 있습니다.
//하는 .m
@implementation ViewController
@synthesize images;
...
- (void)awakeFromNib
{
if (self) {
//set up carousel data
//wrap YES = infinite loop
wrap = YES;
self.images = [NSMutableArray arrayWithObjects:
@"apple.jpg",@"lemon.jpg",@"orange.jpg",@"melon.jpg",@"mango.jpg",nil];
}
}
- (UIView *)carousel:(iCarousel *)_carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view
{
if (view == nil)
{
view = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[images objectAtIndex:index]]];
}
return view;
}
// .H 내가 할 코드를 원하는 그래서 30 개 이미지를 추가 할 계획되었다
@interface ViewController : UIViewController <iCarouselDataSource, iCarouselDelegate>{
NSMutableArray *images;
...
}
@property (nonatomic,retain) NSMutableArray *images;
…
@end
유지할 수있는. 내 문제는 NSBundle 또는 응용 프로그램 디렉토리에서 이미지를 가져올 수 있기를 원하지만 다른 코드를 시도했지만 회전식 캐 러셀에 이미지가 나타나지 않습니다. 당신의 도움을 주셔서 감사합니다.
위임자와 데이터 소스를 설정 했습니까? 내가 본 것처럼 좋은거야 – adali
예 이미 설정했습니다. – Bazinga
당신의 문제는 무엇입니까? – adali