FBProfilePictureView object won't show image

前端 未结 7 1431
别跟我提以往
别跟我提以往 2020-12-18 22:34

I\'m doing the scrumptios facebook developer tutorial for the 3.1 iOS SDK. I\'ve managed to display my profile name from facebook, however the FBProfilePictureView wont show

7条回答
  •  盖世英雄少女心
    2020-12-18 23:26

    They(fb developer forum) said paste that in your app delegate didLunch method like that

     - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
        {
            self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    
    
    
            [FBProfilePictureView class];
    
    
    
            // Create a LoginUIViewController instance where the login button will be
            LoginUIViewController *loginUIViewController = [[LoginUIViewController alloc] init];
    
            // Set loginUIViewController as root view controller
            [[self window] setRootViewController:loginUIViewController];
    
            self.window.backgroundColor = [UIColor whiteColor];
            [self.window makeKeyAndVisible];
            return YES;
        }
    

    just replace

        [FBProfilePictureView class]; 
    
    with these commented lines it will work 
    
        // Override point for customization after application launch.
    
        // Load the FBProfilePictureView
        // You can find more information about why you need to add this line of code in our troubleshooting guide
        // https://developers.facebook.com/docs/ios/troubleshooting#objc
        [FBProfilePictureView class];
    

    it will work magically :)

提交回复
热议问题