0

As I am new for using Observer pattern. I am having application running well on iOS7 and lower versions.

I upgrated my application to iOS8 with XCode 6. When I open my application very first time in XCode 6 and run it, without showing any error message my application crash.

I tried by applying debugger and exception break point.

What I found is that my application is crashing at addObserver: line code. What I am doing is:

  1. My application first opens login screen,
  2. User have to enter the username & password.
  3. If its new user then then logged in, and username & password is saved into database.
  4. Inside user is having option to update his password & save in DB.

Now when user logged in second time, my observer is not catching change in password.

Same line of code is working fine on lower version. I am doing something wrong? My code:

SqlLiteUser *userObj =(SqlLiteUser*)[objDAOFactory getUserDAO];
[userDAO addObserver:self forKeyPath:@"sendPasswordStatus" options:(NSKeyValueObservingOptionNew) context:@selector(handleSendPasswordResult:)];

[userDAO addObserver:self forKeyPath:@"noConnection" options:(NSKeyValueObservingOptionNew) context:@selector(noConnection)];
Szu
  • 2,254
  • 1
  • 21
  • 37
Sagar
  • 1,286
  • 3
  • 19
  • 34

0 Answers0