Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-04-2010, 08:15 PM   #1 (permalink)
Student Developer
 
KidCudi10's Avatar
 
Join Date: May 2010
Posts: 55
KidCudi10 is on a distinguished road
Exclamation Set Label to Twitter Username

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!

Last edited by KidCudi10; 08-08-2010 at 10:42 PM.
KidCudi10 is offline   Reply With Quote
Old 08-08-2010, 10:59 PM   #2 (permalink)
Student Developer
 
KidCudi10's Avatar
 
Join Date: May 2010
Posts: 55
KidCudi10 is on a distinguished road
Default

...
KidCudi10 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 325
10 members and 315 guests
alexP, arash5500, gordo26, mediaspree, nobstudio, Objective Zero, rayjeong, Sloshmonster, stanny, Touchmint
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,655
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, pungs
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:23 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0