This repository has been archived by the owner on Jun 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DWPerson.m
132 lines (99 loc) · 2.2 KB
/
DWPerson.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
//
// MyProf.m
// Tweeterena
//
// Created by Dominic Wroblewski on 03/11/2010.
// Copyright 2010 TerraCoding. All rights reserved.
//
#import "DWPerson.h"
@implementation DWPerson
- (DWPerson *)initWithUser:(NSString*)user {
username = user;
realName = @"";
latestTweet = @"";
latestTweetID = @"";
imageUrl = @"";
location = @"";
description = @"";
imageUrl = @"";
return self;
}
- (DWPerson *)initWithUserInfo:(NSDictionary*)info {
username = @"blank username";
latestTweet = @"";
latestTweetID = @"";
imageUrl = @"";
location = @"";
[self setRealName:[info objectForKey:@"name"]];
[self setUsername:[info objectForKey:@"screen_name"]];
if([[info valueForKey:@"location"] isEqual:[NSNull null]])
{
[self setLocation:@""];
}else{
[self setLocation:[info objectForKey:@"location"]];
}
if ([[info valueForKey:@"description"] isEqual:[NSNull null]]) {
[self setDescription:@""];
}else {
[self setDescription:[info valueForKey:@"description"]];
}
[self setFollowers:[info objectForKey:@"followers_count"]];
[self setFollowing:[info objectForKey:@"friends_count"]];
if([[info valueForKey:@"url"] isEqual:[NSNull null]])
{
[self setURLi:@""];
}else{
[self setURLi:[info valueForKey:@"url"]];
}
[self setImageUrl:[info valueForKey:@"profile_image_url"]];
return self;
}
- (void)setUsername:(NSString*)user {
username = user;
}
- (NSString *)getUsername {
return username;
}
- (void)setRealName:(NSString*)real {
realName = real;
}
- (NSString *)getRealName {
return realName;
}
- (void)setLocation:(NSString*)loc {
location = loc;
}
- (NSString *)getLocation {
return location;
}
- (void)setDescription:(NSString*)desc {
description = desc;
}
- (NSString *)getDescription {
return description;
}
- (void)setURLi:(NSString*)URL {
url = URL;
}
- (NSString *)getURLi {
return url;
}
- (void)setFollowers:(NSString*)followers {
noFollowers = followers;
}
- (NSString *)getFollowers {
return noFollowers;
}
- (void)setFollowing:(NSString*)following {
noFollowing = following;
}
- (NSString *)getFollowing {
return noFollowing;
}
- (void)setImageUrl:(NSString*)imageStr {
imageUrl = imageStr;
}
- (NSString *)getImageUrl {
return imageUrl;
}
@end