0

I have been able to pass the user.name facebook properties to profileViewController.

But I'm not able to send the FBProfilePicture though here is the method below:

// this method will be called when the user information has been fetched
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView user:(id<FBGraphUser>)user
{
    FBProfilePicture.profileID = user.id;
    FBNamePass = user.name;
    [self pushViewController:FBNamePass andProfilePicture:FBProfilePicture];
}

and here's the method:

- (void)pushViewController:(NSString *)user andProfilePicture:(FBProfilePictureView *)profilePicture
{
    NeXtViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"NeXt"];
    controller.FBNameString = user;
    //controller.profilePicture.profileID = profilePicture.profileID;
    [controller setFBProfilePicture:profilePicture];
    [self.navigationController pushViewController:controller animated:NO];
}

Is there anything im doing wrong?

Irfan
  • 4,301
  • 6
  • 29
  • 46

1 Answers1

0

It seems that firstly you need initialize object and only then set property for it:

FBProfilePicture = [[FBProfilePictureClass alloc] init];
FBProfilePicture.profileID = user.id;
Vlad Papko
  • 13,184
  • 4
  • 41
  • 57
  • and where do i place this in the profileViewCOntroller viewDidLoad; – user2257386 Mar 20 '14 at 23:42
  • or in the loginViewController because i init the object when i made an IBOutlet with using the UIView and changed the class to FBProfilePictureView – user2257386 Mar 20 '14 at 23:46
  • you could place it in `- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView user:(id)user` before pushing profile view controller. – Vlad Papko Mar 21 '14 at 08:21