ios - Link View Controllers to Mirror -


my application has facebook login screen, after login shows profile picture, username, email, , logout button.

i trying figure out how link current users profile picture uiview or uiimageview (which ever more applicable, given used uiview called fbprofilepictureview) in main vc called homeviewcontroller. here code have loginviewcontroller has fb information asked , returned. have segue homeviewcontroller once user info has been entered.

loginviewcontroller.h:

#import <uikit/uikit.h> #import <quartzcore/quartzcore.h> #import <facebooksdk/facebooksdk.h>  @interface loginviewcontroller : uiviewcontroller <fbloginviewdelegate>  @property (weak, nonatomic) iboutlet fbloginview *loginbutton;  @property (weak, nonatomic) iboutlet uilabel *lblloginstatus;  @property (weak, nonatomic) iboutlet uilabel *lblusername;  @property (weak, nonatomic) iboutlet uilabel *lblemail;  @property (weak, nonatomic) iboutlet fbprofilepictureview *profilepicture;  @property (strong, nonatomic) iboutlet uiimageview *loginwallpaper; @property (strong, nonatomic) iboutlet uiimageview *loggedinwallpaper;  @property (strong, nonatomic) iboutlet uiimageview *fblogin; @property (strong, nonatomic) iboutlet uiimageview *fblogout;  @end 

and here loginviewcontroller.m

#import "loginviewcontroller.h"  @interface loginviewcontroller ()  - (void)togglehiddenstate:(bool)shouldhide;  @end  @implementation loginviewcontroller  - (void)viewdidload {     [super viewdidload];      [self togglehiddenstate:yes];     self.lblloginstatus.text = @"";      self.loginbutton.readpermissions = @[@"public_profile", @"email"];     self.loginbutton.layer.cornerradius = 0;     [self.loginbutton.layer setborderwidth:0.0f];      self.loginbutton.delegate = self;       // additional setup after loading view. }  -(void)togglehiddenstate:(bool)shouldhide{     self.lblusername.hidden = shouldhide;     self.lblemail.hidden = shouldhide;     self.profilepicture.hidden = shouldhide;     self.loggedinwallpaper.hidden = shouldhide;     self.fblogout.hidden = shouldhide; }  -(void)toggleunhiddenstate:(bool)shouldshow{     self.loggedinwallpaper.hidden = no; }  -(void)loginviewshowingloggedinuser:(fbloginview *)loginview{     self.lblloginstatus.text = @"";      [self togglehiddenstate:no];     [self toggleunhiddenstate:yes]; }  -(void)loginviewshowingloggedoutuser:(fbloginview *)loginview{     self.lblloginstatus.text = @"";      [self togglehiddenstate:yes]; }  -(void)loginviewfetcheduserinfo:(fbloginview *)loginview user:(id<fbgraphuser>)user{     nslog(@"%@", user);     self.profilepicture.profileid = user.objectid;     self.lblusername.text = user.name;     self.lblemail.text = [user objectforkey:@"email"];      uistoryboard *storyboard = [uistoryboard storyboardwithname:@"main" bundle:nil];     uitabbarcontroller *tabcontroller = (uitabbarcontroller *)[storyboard instantiateviewcontrollerwithidentifier:@"homeviewcontroller"];     [self presentviewcontroller:tabcontroller animated:yes completion:nil]; }  -(void)loginview:(fbloginview *)loginview handleerror:(nserror *)error{     nslog(@"%@", [error localizeddescription]); }  - (void)didreceivememorywarning {     [super didreceivememorywarning];     // dispose of resources can recreated. }  /* #pragma mark - navigation  // in storyboard-based application, want little preparation before navigation - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender {     // new view controller using [segue destinationviewcontroller].     // pass selected object new view controller. } */  @end 

all of other questions posted on here have not helped me - have been vague.

if show me how connect profile picture uiimageview or uiview in homeviewcontroller awesome! know easy , i'm frustrated giving me such problem

(i know need use prepareforseuge method not sure on syntax of how accomplish this.)

it you. go homeviewcontroller.xib , here put uiview dragging it.

now, select view , on right side of xcode click on third tab identity inspector. here set class name fbprofilepictureview try.


Comments

Popular posts from this blog

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -