Here is the testing code:

```
id dataControllerMock = [OCMockObject mockForClass:[RAMImsakyaDataController class]];
[[[dataControllerMock expect] andReturn:dataControllerMock] alloc];
(void)[[[dataControllerMock expect] andReturn:dataControllerMock] init];
[[[dataControllerMock stub] andReturn:@"30.06 , 50.67"] getLocationTitle];
[self.viewController viewDidLoad];
XCTAssertTrue([self.viewController.title isEqualToString:@"30.06 , 50.67"], @"View controller title is wrong");
[dataControllerMock verify];

```

The problem is that the dataControllerMock causing a failure with "unexpected method invoked: getLocationTitle"! I do stub the method. And even if I change the stub to expect, same thing. When I breakpoint inside viewDidLoad, the mock is already there as expected yet it doesn't recognize the getLocationTitle method.

Update: here is the viewDidLoad code

```
NSString *location = [self.dataController getLocationTitle];
if (location == nil) {
    self.title = @"إمساكية رمضان ١٤٣٥ هـ";

} else {
    self.title = [NSString stringWithFormat:@"إمساكية رمضان ١٤٣٥ هـ (توقيت %@)", location];

}

```