iCarousel in Xcode 5.0.2, multiple carousels in one view controller not getting caraousel's instance

StackOverflow https://stackoverflow.com/questions/20494646

  •  31-08-2022
  •  | 
  •  

سؤال

Created a project in Xcode 5.0.2 with storyboarding, autolayout and 3 carrousel's in one viewcontroller

  1. imported icarousel in the viewcontroller.
  2. Connected delegate, datasource.
  3. Connected carousels to different objects of icarousels.

    @property (nonatomic, strong) IBOutlet iCarousel *carousel1;
    @property (nonatomic, strong) IBOutlet iCarousel *carousel2;
    @property (nonatomic, strong) IBOutlet iCarousel *carousel3;
    

When I run the project delegate, datasource are working fine, but when i am trying to check the instance as below

    - (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel
    {
        //return the total number of items in the carousel
        //return the total number of items in the carousel
        NSLog(@"Carousel%@", carousel);
            NSLog(@"carousel1%@", carousel1);
        NSInteger itemsTMP;
        if (carousel == self.carousel1)
        {
            itemsTMP = [_items count];
        }

In the nslog it showing as NULL for carousel1.

All the connections seems to be perfect. Unable to figure out the mistake.

هل كانت مفيدة؟

المحلول 2

No problem with RestKit adding to the project. Still not sure. How to solve the problem.
Followed below steps to overcome the issue:
1. Deleted the old view and associated view controllers.
2. Created new view, New controller. Be careful with connections and remove it before deleting any associated views. 3. Hurray the got instances of carousels worked.

But above seemed like a work around but still didn't figure out the issue.

نصائح أخرى

Hate to overstate the obvious here, but the fact that no '*' precedes the carousel1 property would be the first remedy I'd perform.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top