I need help pulling in a twitter user's name (not screen name). This is what I've done so far.
I've added Aral's xAuthEngine to my project which includes the latest MGTwitterEngine. Everything is working correctly. The user can log in and out. I have a view with a label titled nameLabel.
I created a User.h/.m file:
Code:
#import <Foundation/Foundation.h>
@interface User : NSObject {
NSDate *created_at;
NSNumber *favourites_count;
NSNumber *followers_count;
BOOL following;
NSNumber *friends_count;
NSNumber *ident;
NSString *name;
NSString *description;
NSString *location;
BOOL notifications;
NSString *profile_background_color;
NSString *profile_background_image_url;
NSString *profile_background_tile;
NSString *profile_image_url;
NSString *profile_link_color;
NSString *profile_sidebar_border_color;
NSString *profile_sidebar_fill_color;
NSString *profile_text_color;
BOOL protected;
NSString *screen_name;
NSNumber *statuses_count;
}
@property (nonatomic, retain) NSDate *created_at;
@property (nonatomic, retain) NSNumber *favourites_count;
@property (nonatomic, retain) NSNumber *followers_count;
@property BOOL following;
@property (nonatomic, retain) NSNumber *friends_count;
@property (nonatomic, retain) NSNumber *ident;
@property (nonatomic, retain) NSString *name;
@property (nonatomic, retain) NSString *description;
@property (nonatomic, retain) NSString *location;
@property BOOL notifications;
@property (nonatomic, retain) NSString *profile_background_color;
@property (nonatomic, retain) NSString *profile_background_image_url;
@property (nonatomic, retain) NSString *profile_background_tile;
@property (nonatomic, retain) NSString *profile_image_url;
@property (nonatomic, retain) NSString *profile_link_color;
@property (nonatomic, retain) NSString *profile_sidebar_border_color;
@property (nonatomic, retain) NSString *profile_sidebar_fill_color;
@property (nonatomic, retain) NSString *profile_text_color;
@property BOOL protected;
@property (nonatomic, retain) NSString *screen_name;
@property (nonatomic, retain) NSNumber *statuses_count;
@end
In my view I imported the user header file, the xauthengine header file, referenced the classes, and everything that there is to do.
Now in my view I created an IB Outlet for the label and connected it. I've set the following label to be the name of the user that's logged in. This is how I did that:
Code:
nameLabel.text = user.name;
The "user" turns green, and the "name" turns purple. But when I build, the label stays default.
CAN ANYONE PLEASE HELP! Thanks so much in advance!