Question: I found the pattern used by the Google places IOS SDK to be clean and well designed. Basically they follow what is presented on the following apple presentation: [Advanced User interface with Collection view](https://developer.apple.com/videos/play/wwdc2014/232/) (It start slide 46).

This is what is implemented in their GMSAutocompleteTableDataSource.
It us up to the datasource to define the state of the tableview.
We link the tableview.

```
var googlePlacesDataSource = GMSAutocompleteTableDataSource()
tableView.dataSource = googlePlacesDataSource
tableView.delegate = googlePlacesDataSource

```

Then every time something change the event is binded to the datasource:

```
googlePlacesDataSource.sourceTextHasChanged("Newsearch")

```

The data source perform the query set the table view as loading and then display the result.

I would like to achieve this from my custom Source:

```
class JourneyTableViewDataSource:NSObject, UITableViewDataSource, UITableViewDelegate{
   private var journeys:[JourneyHead]?{
        didSet{
         -> I want to trigger tableView.reloadData() when this list is populated... 
         -> How do I do that? I do not have a reference to tableView?
        }
   }

    override init(){
        super.init()
    }

    func numberOfSections(in tableView: UITableView) -> Int {
        return 1
    }
    ...
}

```

Any idea?

Answer: 
Change this:

```
A* a;

```

to this:

```
::A* a;

```

since `C` inherits from `B`, and `B` from `A`, thus you need the scope resolution operator to do the trick.

Instead of starting at the local scope which includes the class parents, `::A` starts looking at the global scope because of the `::`. 

From the [Standard](http://open-std.org/JTC1/SC22/WG21/docs/papers/2015/n4567.pdf):

> 
> **11.1.5 Acess Specifiers**
> 
> 
> In a derived class, the lookup of a base class name will find the
>  injected-class-name instead of the name of the base class in the scope
>  in which it was declared. The injected-class-name might be less
>  accessible than the name of the base class in the scope in which it
>  was declared.
> 
> 
>
ISO C++: 11.1 Access Specifiers

> 
> 5 [Note: In a derived class, the lookup of a base class name will ﬁnd the injected-class-name instead of the name of the base class in the scope in which it was declared. The injected-class-name might be less accessible than the name of the base class in the scope in which it was declared. —end note] 
> 
> 
> 

And the example from the standard:

```
class A { };
class B : private A { };
class C : public B {
    A* p; // error: injected-class-name A is inaccessible
   ::A* q; // OK 
};

```

---

[N3797 Working Draft, Standard for Programming Language C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3797.pdf)