ios - PresentViewController from NSObject? -


okay problem i'm having in 1 of functions when users logging in through facebook, , app checking wether or not facebook username exists in our app (parse.com) database.

if so, present view controller (which i'm having problem since in nsobject) if not, write facebook username parse username string. error is: no known class method selector 'presentviewcontroller:animated:completion'

here code:

pfquery *query = [pfuser query]; //1 [query wherekey:@"username" equalto:me.username];//2 [query findobjectsinbackgroundwithblock:^(nsarray *objects, nserror *error) {//4      if (!error) {         nslog(@"successfully retrieved: %@", objects);          if ([objects count] > 0)         {             // looking present view controller here?              //    tried:             //    [self presentviewcontroller:[@"registerusername" animated:yes completion:nil];           } else {             [[pfuser currentuser] setobject:me.username forkey:@"username"];         }     } else {         nsstring *errorstring = [[error userinfo] objectforkey:@"error"];         nslog(@"error: %@", errorstring);     } }]; 

and since inheriting nsobject, won't allow me use presentviewcontroller. not sure else here. :-( view controller going make them set username before continuing our app. code in login function in header comms.h (nsobject) facebook ios sdk

nsobject not declare method presentviewcontroller:. you'll need add uiviewcontroller subclass window , present that. in completion block of dismissviewcontroller should remove parent window.

alternatively create delegate protocol checking username , notify uiviewcontroller of need either set username internally or present login view.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -