iCarousel USING_CHAMELEON issue or NSRUNLOOP

372 views Asked by At

I need to use iCarousel Carousel of type iCarouselTypeRotary

I am currently using the carousel downloaded from the below link: http://mobile.tutsplus.com/tutorials/iphone/create-an-awesome-carousel-version-2-0/?search_index=2

It works on all simulators except on iPhone 4 inch 64 bit stimulator It crashes on line:

[timer addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];

The above line in written in iCarousel.m startAnimation function It somehow goes in:

#ifdef ICAROUSEL_IOS
#ifndef USING_CHAMELEON

        //support for Chameleon
        timer = [CADisplayLink displayLinkWithTarget:self selector:@selector(step)];
        [timer addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
#endif

I have not done anything to use CHAMELEON.

Please help me to solve crash.

I then tried downloading the carousel files from:

https://github.com/nicklockwood/iCarousel

but somehow I am not able to do click with large width in iCarouselTypeRotary so I had to use from the mobile tut plus only, but in that it is crashing in iPhone retina 4 inch 64 bit simulator.

Please help.

1

There are 1 answers

0
Anjani On

For anyone who ever faces the problem:

Sometimes the timer was not getting allocated in carousel.m file the property was written as:

@property (nonatomic, __unsafe_unretained)

We changed it to:

@property (nonatomic, retain)

Also even after assigning it on previous line we check if timer is present if present then only we do addToRunLoop method.

Now it is working.