Develop

[2014-12-09 13:11:00 EEvL] Pull Request current develop branch into master.
We do have the same switch, but the result’s of the switch cases is different enough to warrant multiple uses of same switch block.

The results of the switch blocks are close enough for tableView:numberOfRowsInSection: and tableView:(UITableView *)tableView cellForRowAtIndexPath: that they could be moved off to a single private method that returns an NSArray that numberOfRowsInSection: could return .count of and cellForIndexPath: could get the objectAtIndex: of and use.

> On Dec 10, 2014, at 5:44 AM, arctouch-caiofonseca <notifications@github.com> wrote:
> 
> In ArcTouchCodeChallenge/ArcTouchCodeChallenge/Sources/Controllers/DetailViewController.m <https://github.com/hockeygod/ArcTouchCodeChallenge/pull/1#discussion-diff-21603311>:
> 
> > +    }
> > +    //Departures
> > +    if ([tableView isEqual:self.departuresTableView])
> > +    {
> > +        UITableViewCell *returnCell = [tableView dequeueReusableCellWithIdentifier:@"DetailViewDepartureCell"];
> > +        
> > +        if (returnCell == nil)
> > +        {
> > +            returnCell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"DetailViewDepartureCell"];
> > +        }
> > +        
> > +        Departure *departureForIndexPath = nil;
> > +        switch (indexPath.section) {
> > +            case 0: //Weekdays
> > +            {
> > +                departureForIndexPath = [self.departures filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"%K like %@", @"calendar", CALENDAR_WEEKDAY]][indexPath.row];
> we have almost the same code above, right?
> 
> —
> Reply to this email directly or view it on GitHub <https://github.com/hockeygod/ArcTouchCodeChallenge/pull/1/files#r21603311>.
>