Develop

[2014-12-09 13:11:00 EEvL] Pull Request current develop branch into master.
The results of the switch blocks are close enough for tableView:numberOfRowsInSection: and tableView:cellForRowAtIndexPath: that it makes more sense and adds readability to the file if these switches were 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:43 AM, arctouch-caiofonseca <notifications@github.com> wrote:
> 
> In ArcTouchCodeChallenge/ArcTouchCodeChallenge/Sources/Controllers/DetailViewController.m <https://github.com/hockeygod/ArcTouchCodeChallenge/pull/1#discussion-diff-21603264>:
> 
> > +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
> > +{
> > +    NSInteger returnInteger = 0;
> > +    
> > +    //Stops
> > +    if ([tableView isEqual:self.stopsTableView])
> > +    {
> > +        returnInteger = self.stops.count;
> > +    }
> > +    //Departures
> > +    else if ([tableView isEqual:self.departuresTableView])
> > +    {
> > +        switch (section) {
> > +            case 0: //Weekdays
> > +            {
> > +                returnInteger = [self.departures filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"%K like %@", @"calendar", CALENDAR_WEEKDAY]].count;
> extract this to a method to avoid repeating code 3 times
> 
> —
> Reply to this email directly or view it on GitHub <https://github.com/hockeygod/ArcTouchCodeChallenge/pull/1/files#r21603264>.
>