You were actually really close. You were missing the very first brace in the beginning of the method. In the future, Xcode will point you to a location at least near the error which you can use as a starting point to analyze your code. Always make sure to count and balance opening and closing braces, brackets, and parens.
- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view
{ // <--- This brace was missing!!
if (view == nil)
{
view = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 200.0f, 200.0f)];
UIImage *image;
if (carousel == carousel1)
{
image = [UIImage imageWithContentsOfFile:[imageArray1 objectAtIndex:index]];
((UIImageView *)view).image = image;
}
else
{
image = [UIImage imageWithContentsOfFile:[imageArray2 objectAtIndex:index]];
((UIImageView *)view).image = image;
}
return view;
}
else {
UIImage *image;
if (carousel == carousel1)
{
image = [UIImage imageWithContentsOfFile:[imageArray1 objectAtIndex:index]];
((UIImageView *)view).image = image;
}
else
{
image = [UIImage imageWithContentsOfFile:[imageArray2 objectAtIndex:index]];
((UIImageView *)view).image = image;
}
}
return view;
}