| 1 | // |
|---|
| 2 | // TypePadAccount.m |
|---|
| 3 | // Fence |
|---|
| 4 | // |
|---|
| 5 | // Created by Nicholas Gerakines on 6/10/06. |
|---|
| 6 | // Copyright 2006 __MyCompanyName__. All rights reserved. |
|---|
| 7 | // |
|---|
| 8 | |
|---|
| 9 | #import "TypePadAccount.h" |
|---|
| 10 | #import "TypePadWeblog.h" |
|---|
| 11 | #import "TypePadGallery.h" |
|---|
| 12 | #import "TypePadAtomApi.h" |
|---|
| 13 | |
|---|
| 14 | @implementation TypePadAccount |
|---|
| 15 | |
|---|
| 16 | // init |
|---|
| 17 | - (id)init { |
|---|
| 18 | if (self = [super init]) { |
|---|
| 19 | [self setUsername:@""]; |
|---|
| 20 | [self setPassword:@""]; |
|---|
| 21 | [self setNickname:@""]; |
|---|
| 22 | [self setWeblogs:[[NSMutableArray alloc] init]]; |
|---|
| 23 | [self setGalleries:[[NSMutableArray alloc] init]]; |
|---|
| 24 | [self setTypelists:[[NSMutableArray alloc] init]]; |
|---|
| 25 | // [self setComments:[[NSMutableArray alloc] init]]; |
|---|
| 26 | [self setHasWeblog:NO]; |
|---|
| 27 | [self setHasGallery:NO]; |
|---|
| 28 | [self setHasTypeList:NO]; |
|---|
| 29 | [self setDefaultWeblog:@""]; |
|---|
| 30 | [self setDefaultGallery:@""]; |
|---|
| 31 | } |
|---|
| 32 | return self; |
|---|
| 33 | } |
|---|
| 34 | |
|---|
| 35 | /* dealloc */ |
|---|
| 36 | - (void) dealloc { |
|---|
| 37 | [username release]; |
|---|
| 38 | [password release]; |
|---|
| 39 | [nickname release]; |
|---|
| 40 | [weblogs release]; |
|---|
| 41 | [galleries release]; |
|---|
| 42 | [typelists release]; |
|---|
| 43 | [comments release]; |
|---|
| 44 | [defaultWeblog release]; |
|---|
| 45 | [defaultGallery release]; |
|---|
| 46 | |
|---|
| 47 | username = nil; |
|---|
| 48 | password = nil; |
|---|
| 49 | nickname = nil; |
|---|
| 50 | weblogs = nil; |
|---|
| 51 | galleries = nil; |
|---|
| 52 | typelists = nil; |
|---|
| 53 | comments = nil; |
|---|
| 54 | defaultWeblog = nil; |
|---|
| 55 | defaultGallery = nil; |
|---|
| 56 | [super dealloc]; |
|---|
| 57 | } |
|---|
| 58 | |
|---|
| 59 | - (void) encodeWithCoder: (NSCoder *)coder { |
|---|
| 60 | // [super encodeWithCoder: coder]; |
|---|
| 61 | [coder encodeObject: [self username] forKey: @"WeblogUsername"]; |
|---|
| 62 | [coder encodeObject: [self password] forKey: @"WeblogPassword"]; |
|---|
| 63 | [coder encodeObject: [self nickname] forKey: @"WeblogNickname"]; |
|---|
| 64 | [coder encodeObject: [self weblogs] forKey: @"WeblogWeblogs"]; |
|---|
| 65 | [coder encodeObject: [self galleries] forKey: @"WeblogGalleries"]; |
|---|
| 66 | [coder encodeObject: [self typelists] forKey: @"WeblogTypelists"]; |
|---|
| 67 | // [coder encodeObject: [self comments] forKey: @"WeblogComments"]; |
|---|
| 68 | [coder encodeBool: [self hasWeblog] forKey: @"WeblogHasWeblog"]; |
|---|
| 69 | [coder encodeBool: [self hasGallery] forKey: @"WeblogHasGallery"]; |
|---|
| 70 | [coder encodeBool: [self hasTypeList] forKey: @"WeblogHasTypeList"]; |
|---|
| 71 | [coder encodeObject: [self defaultWeblog] forKey: @"WeblogDefaultWeblog"]; |
|---|
| 72 | [coder encodeObject: [self defaultGallery] forKey: @"WeblogDefaultGallery"]; |
|---|
| 73 | } |
|---|
| 74 | |
|---|
| 75 | - (id) initWithCoder: (NSCoder *)coder { |
|---|
| 76 | // if ([super initWithCoder: coder]) { |
|---|
| 77 | [self setUsername: [coder decodeObjectForKey: @"WeblogUsername"]]; |
|---|
| 78 | [self setPassword: [coder decodeObjectForKey: @"WeblogPassword"]]; |
|---|
| 79 | [self setNickname: [coder decodeObjectForKey: @"WeblogNickname"]]; |
|---|
| 80 | [self setWeblogs: [coder decodeObjectForKey: @"WeblogWeblogs"]]; |
|---|
| 81 | [self setGalleries: [coder decodeObjectForKey: @"WeblogGalleries"]]; |
|---|
| 82 | [self setTypelists: [coder decodeObjectForKey: @"WeblogTypelists"]]; |
|---|
| 83 | // [self setComments: [coder decodeObjectForKey: @"WeblogComments"]]; |
|---|
| 84 | [self setHasWeblog: [coder decodeBoolForKey: @"WeblogHasWeblog"]]; |
|---|
| 85 | [self setHasGallery: [coder decodeBoolForKey: @"WeblogHasGallery"]]; |
|---|
| 86 | [self setHasTypeList: [coder decodeBoolForKey: @"WeblogHasTypeList"]]; |
|---|
| 87 | [self setDefaultWeblog: [coder decodeObjectForKey: @"WeblogDefaultWeblog"]]; |
|---|
| 88 | [self setDefaultGallery: [coder decodeObjectForKey: @"WeblogDefaultGallery"]]; |
|---|
| 89 | // } |
|---|
| 90 | return self; |
|---|
| 91 | } |
|---|
| 92 | |
|---|
| 93 | #pragma mark - |
|---|
| 94 | |
|---|
| 95 | /* username */ |
|---|
| 96 | - (NSString *) username { return username; } |
|---|
| 97 | |
|---|
| 98 | /* -setUsername: */ |
|---|
| 99 | - (void) setUsername: (NSString *) Username { |
|---|
| 100 | //NSLog(@"in -setUsername:, old value of username: %@, changed to: %@", username, Username); |
|---|
| 101 | if (username != Username) { |
|---|
| 102 | [username autorelease]; |
|---|
| 103 | username = [Username retain]; |
|---|
| 104 | } |
|---|
| 105 | } |
|---|
| 106 | |
|---|
| 107 | /* password */ |
|---|
| 108 | - (NSString *) password { return password; } |
|---|
| 109 | |
|---|
| 110 | /* -setPassword: */ |
|---|
| 111 | - (void) setPassword: (NSString *) Password { |
|---|
| 112 | //NSLog(@"in -setPassword:, old value of password: %@, changed to: %@", password, Password); |
|---|
| 113 | if (password != Password) { |
|---|
| 114 | [password autorelease]; |
|---|
| 115 | password = [Password retain]; |
|---|
| 116 | } |
|---|
| 117 | } |
|---|
| 118 | |
|---|
| 119 | /* nickname */ |
|---|
| 120 | - (NSString *) nickname { return nickname; } |
|---|
| 121 | |
|---|
| 122 | /* -setNickname: */ |
|---|
| 123 | - (void) setNickname: (NSString *) Nickname { |
|---|
| 124 | //NSLog(@"in -setNickname:, old value of nickname: %@, changed to: %@", nickname, Nickname); |
|---|
| 125 | if (nickname != Nickname) { |
|---|
| 126 | [nickname autorelease]; |
|---|
| 127 | nickname = [Nickname retain]; |
|---|
| 128 | } |
|---|
| 129 | } |
|---|
| 130 | |
|---|
| 131 | /* hasWeblog */ |
|---|
| 132 | - (BOOL) hasWeblog { return hasWeblog; } |
|---|
| 133 | |
|---|
| 134 | /* -setHasWeblog: */ |
|---|
| 135 | - (void) setHasWeblog: (BOOL) flag { |
|---|
| 136 | //NSLog(@"in -setHasWeblog, old value of hasWeblog: %@, changed to: %@", (hasWeblog ? @"YES": @"NO"), (flag ? @"YES": @"NO") ); |
|---|
| 137 | hasWeblog = flag; |
|---|
| 138 | } |
|---|
| 139 | |
|---|
| 140 | /* hasGallery */ |
|---|
| 141 | - (BOOL) hasGallery { return hasGallery; } |
|---|
| 142 | |
|---|
| 143 | /* -setHasGallery: */ |
|---|
| 144 | - (void) setHasGallery: (BOOL) flag { |
|---|
| 145 | //NSLog(@"in -setHasGallery, old value of hasGallery: %@, changed to: %@", (hasGallery ? @"YES": @"NO"), (flag ? @"YES": @"NO") ); |
|---|
| 146 | hasGallery = flag; |
|---|
| 147 | } |
|---|
| 148 | |
|---|
| 149 | /* hasTypeList */ |
|---|
| 150 | - (BOOL) hasTypeList { return hasTypeList; } |
|---|
| 151 | |
|---|
| 152 | /* -setHasTypeList: */ |
|---|
| 153 | - (void) setHasTypeList: (BOOL) flag { |
|---|
| 154 | //NSLog(@"in -setHasTypeList, old value of hasTypeList: %@, changed to: %@", (hasTypeList ? @"YES": @"NO"), (flag ? @"YES": @"NO") ); |
|---|
| 155 | hasTypeList = flag; |
|---|
| 156 | } |
|---|
| 157 | |
|---|
| 158 | /* weblogs */ |
|---|
| 159 | - (NSMutableArray *) weblogs { return weblogs; } |
|---|
| 160 | |
|---|
| 161 | /* -setWeblogs: */ |
|---|
| 162 | - (void) setWeblogs: (NSMutableArray *) Weblogs { |
|---|
| 163 | //NSLog(@"in -setWeblogs:, old value of weblogs: %@, changed to: %@", weblogs, Weblogs); |
|---|
| 164 | if (weblogs != Weblogs) { |
|---|
| 165 | [weblogs autorelease]; |
|---|
| 166 | weblogs = [Weblogs retain]; |
|---|
| 167 | } |
|---|
| 168 | } |
|---|
| 169 | |
|---|
| 170 | /* galleries */ |
|---|
| 171 | - (NSMutableArray *) galleries { return galleries; } |
|---|
| 172 | |
|---|
| 173 | /* -setGalleries: */ |
|---|
| 174 | - (void) setGalleries: (NSMutableArray *) Galleries { |
|---|
| 175 | //NSLog(@"in -setGalleries:, old value of galleries: %@, changed to: %@", galleries, Galleries); |
|---|
| 176 | if (galleries != Galleries) { |
|---|
| 177 | [galleries autorelease]; |
|---|
| 178 | galleries = [Galleries retain]; |
|---|
| 179 | } |
|---|
| 180 | } |
|---|
| 181 | |
|---|
| 182 | /* typelists */ |
|---|
| 183 | - (NSMutableArray *) typelists { return typelists; } |
|---|
| 184 | |
|---|
| 185 | /* -setTypelists: */ |
|---|
| 186 | - (void) setTypelists: (NSMutableArray *) Typelists { |
|---|
| 187 | //NSLog(@"in -setTypelists:, old value of typelists: %@, changed to: %@", typelists, Typelists); |
|---|
| 188 | if (typelists != Typelists) { |
|---|
| 189 | [typelists autorelease]; |
|---|
| 190 | typelists = [Typelists retain]; |
|---|
| 191 | } |
|---|
| 192 | } |
|---|
| 193 | |
|---|
| 194 | /* comments */ |
|---|
| 195 | - (NSMutableArray *) comments { return comments; } |
|---|
| 196 | |
|---|
| 197 | /* -setTypelists: */ |
|---|
| 198 | - (void) setComments: (NSMutableArray *) Comments { |
|---|
| 199 | //NSLog(@"in -setComments:, old value of comments: %@, changed to: %@", comments, Comments); |
|---|
| 200 | if (comments != Comments) { |
|---|
| 201 | [comments autorelease]; |
|---|
| 202 | comments = [Comments retain]; |
|---|
| 203 | } |
|---|
| 204 | } |
|---|
| 205 | |
|---|
| 206 | /* defaultWeblog */ |
|---|
| 207 | - (NSString *) defaultWeblog { return defaultWeblog; } |
|---|
| 208 | |
|---|
| 209 | /* -setDefaultWeblog: */ |
|---|
| 210 | - (void) setDefaultWeblog: (NSString *) DefaultWeblog { |
|---|
| 211 | //NSLog(@"in -setDefaultWeblog:, old value of defaultWeblog: %@, changed to: %@", defaultWeblog, DefaultWeblog); |
|---|
| 212 | if (defaultWeblog != DefaultWeblog) { |
|---|
| 213 | [defaultWeblog autorelease]; |
|---|
| 214 | defaultWeblog = [DefaultWeblog retain]; |
|---|
| 215 | } |
|---|
| 216 | } |
|---|
| 217 | |
|---|
| 218 | /* defaultGallery */ |
|---|
| 219 | - (NSString *) defaultGallery { return defaultGallery; } |
|---|
| 220 | |
|---|
| 221 | /* -setDefaultGallery: */ |
|---|
| 222 | - (void) setDefaultGallery: (NSString *) DefaultGallery { |
|---|
| 223 | //NSLog(@"in -setDefaultGallery:, old value of defaultGallery: %@, changed to: %@", defaultGallery, DefaultGallery); |
|---|
| 224 | if (defaultGallery != DefaultGallery) { |
|---|
| 225 | [defaultGallery autorelease]; |
|---|
| 226 | defaultGallery = [DefaultGallery retain]; |
|---|
| 227 | } |
|---|
| 228 | } |
|---|
| 229 | |
|---|
| 230 | |
|---|
| 231 | #pragma mark - |
|---|
| 232 | |
|---|
| 233 | /////// weblogs /////// |
|---|
| 234 | |
|---|
| 235 | - (unsigned int) countOfWeblogs { |
|---|
| 236 | return [[self weblogs] count]; |
|---|
| 237 | } |
|---|
| 238 | |
|---|
| 239 | - (id) objectInWeblogsAtIndex: (unsigned int)index { |
|---|
| 240 | id myWeblogs = [self weblogs]; |
|---|
| 241 | unsigned int weblogsCount = [myWeblogs count]; |
|---|
| 242 | if ( weblogsCount == 0 || index > (weblogsCount - 1) ) return nil; |
|---|
| 243 | return [myWeblogs objectAtIndex: index]; |
|---|
| 244 | } |
|---|
| 245 | |
|---|
| 246 | - (void) insertObject: (id)anObject inWeblogsAtIndex: (unsigned int)index { |
|---|
| 247 | id myWeblogs = [self weblogs]; |
|---|
| 248 | unsigned int weblogsCount = [myWeblogs count]; |
|---|
| 249 | if (index > weblogsCount) return; |
|---|
| 250 | if (anObject) [myWeblogs insertObject: anObject atIndex: index]; |
|---|
| 251 | } |
|---|
| 252 | |
|---|
| 253 | - (void) removeObjectFromWeblogsAtIndex: (unsigned int)index { |
|---|
| 254 | id myWeblogs = [self weblogs]; |
|---|
| 255 | unsigned int weblogsCount = [myWeblogs count]; |
|---|
| 256 | if ( weblogsCount == 0 || index > (weblogsCount - 1) ) return; |
|---|
| 257 | |
|---|
| 258 | [myWeblogs removeObjectAtIndex: index]; |
|---|
| 259 | } |
|---|
| 260 | |
|---|
| 261 | - (void) replaceObjectInWeblogsAtIndex: (unsigned int)index withObject: (id)anObject { |
|---|
| 262 | id myWeblogs = [self weblogs]; |
|---|
| 263 | unsigned int weblogsCount = [myWeblogs count]; |
|---|
| 264 | if ( weblogsCount == 0 || index > (weblogsCount - 1) ) return; |
|---|
| 265 | [myWeblogs replaceObjectAtIndex: index withObject: anObject]; |
|---|
| 266 | } |
|---|
| 267 | |
|---|
| 268 | #pragma mark - |
|---|
| 269 | |
|---|
| 270 | /////// galleries /////// |
|---|
| 271 | |
|---|
| 272 | - (unsigned int) countOfGalleries { |
|---|
| 273 | return [[self galleries] count]; |
|---|
| 274 | } |
|---|
| 275 | |
|---|
| 276 | - (id) objectInGalleriesAtIndex: (unsigned int)index { |
|---|
| 277 | id myGalleries = [self galleries]; |
|---|
| 278 | unsigned int galleriesCount = [myGalleries count]; |
|---|
| 279 | if ( galleriesCount == 0 || index > (galleriesCount - 1) ) return nil; |
|---|
| 280 | return [myGalleries objectAtIndex: index]; |
|---|
| 281 | } |
|---|
| 282 | |
|---|
| 283 | - (void) insertObject: (id)anObject inGalleriesAtIndex: (unsigned int)index { |
|---|
| 284 | id myGalleries = [self galleries]; |
|---|
| 285 | unsigned int galleriesCount = [myGalleries count]; |
|---|
| 286 | if (index > galleriesCount) return; |
|---|
| 287 | if (anObject) [myGalleries insertObject: anObject atIndex: index]; |
|---|
| 288 | } |
|---|
| 289 | |
|---|
| 290 | - (void) removeObjectFromGalleriesAtIndex: (unsigned int)index { |
|---|
| 291 | id myGalleries = [self galleries]; |
|---|
| 292 | unsigned int galleriesCount = [myGalleries count]; |
|---|
| 293 | if ( galleriesCount == 0 || index > (galleriesCount - 1) ) return; |
|---|
| 294 | [myGalleries removeObjectAtIndex: index]; |
|---|
| 295 | } |
|---|
| 296 | |
|---|
| 297 | - (void) replaceObjectInGalleriesAtIndex: (unsigned int)index withObject: (id)anObject { |
|---|
| 298 | id myGalleries = [self galleries]; |
|---|
| 299 | unsigned int galleriesCount = [myGalleries count]; |
|---|
| 300 | if ( galleriesCount == 0 || index > (galleriesCount - 1) ) return; |
|---|
| 301 | [myGalleries replaceObjectAtIndex: index withObject: anObject]; |
|---|
| 302 | } |
|---|
| 303 | |
|---|
| 304 | #pragma mark - |
|---|
| 305 | |
|---|
| 306 | /////// typelists /////// |
|---|
| 307 | |
|---|
| 308 | - (unsigned int) countOfTypelists { |
|---|
| 309 | return [[self typelists] count]; |
|---|
| 310 | } |
|---|
| 311 | |
|---|
| 312 | - (id) objectInTypelistsAtIndex: (unsigned int)index { |
|---|
| 313 | id myTypelists = [self typelists]; |
|---|
| 314 | unsigned int typelistsCount = [myTypelists count]; |
|---|
| 315 | if ( typelistsCount == 0 || index > (typelistsCount - 1) ) return nil; |
|---|
| 316 | return [myTypelists objectAtIndex: index]; |
|---|
| 317 | } |
|---|
| 318 | |
|---|
| 319 | - (void) insertObject: (id)anObject inTypelistsAtIndex: (unsigned int)index { |
|---|
| 320 | id myTypelists = [self typelists]; |
|---|
| 321 | unsigned int typelistsCount = [myTypelists count]; |
|---|
| 322 | if (index > typelistsCount) return; |
|---|
| 323 | if (anObject) [myTypelists insertObject: anObject atIndex: index]; |
|---|
| 324 | } |
|---|
| 325 | |
|---|
| 326 | - (void) removeObjectFromTypelistsAtIndex: (unsigned int)index { |
|---|
| 327 | id myTypelists = [self typelists]; |
|---|
| 328 | unsigned int typelistsCount = [myTypelists count]; |
|---|
| 329 | if ( typelistsCount == 0 || index > (typelistsCount - 1) ) return; |
|---|
| 330 | [myTypelists removeObjectAtIndex: index]; |
|---|
| 331 | } |
|---|
| 332 | |
|---|
| 333 | - (void) replaceObjectInTypelistsAtIndex: (unsigned int)index withObject: (id)anObject { |
|---|
| 334 | id myTypelists = [self typelists]; |
|---|
| 335 | unsigned int typelistsCount = [myTypelists count]; |
|---|
| 336 | if ( typelistsCount == 0 || index > (typelistsCount - 1) ) return; |
|---|
| 337 | [myTypelists replaceObjectAtIndex: index withObject: anObject]; |
|---|
| 338 | } |
|---|
| 339 | |
|---|
| 340 | #pragma mark - |
|---|
| 341 | |
|---|
| 342 | - (void) discoverWeblogs { |
|---|
| 343 | TypePadAtomAPI *client = [[[TypePadAtomAPI alloc] init] autorelease]; |
|---|
| 344 | [client setDataarg:@""]; |
|---|
| 345 | [client setAuth:[self username] pass:[self password]]; |
|---|
| 346 | [client newpost:@"3" args:nil]; |
|---|
| 347 | NSXMLDocument *xmlDoc = [[NSXMLDocument alloc] initWithXMLString:[client resdata] options:(NSXMLNodePreserveWhitespace|NSXMLNodePreserveCDATA) error:nil]; |
|---|
| 348 | NSArray *nodes = [xmlDoc nodesForXPath:@"/feed/link[@rel=\"service.post\"]" error:nil]; |
|---|
| 349 | int arrayCount = [nodes count]; |
|---|
| 350 | int i = 0; |
|---|
| 351 | for (i = 0; i < arrayCount; i++) { |
|---|
| 352 | NSXMLElement *token = [nodes objectAtIndex:i]; |
|---|
| 353 | TypePadWeblog *tpobj = [[TypePadWeblog alloc] init]; |
|---|
| 354 | [tpobj setAuth:[self username] pass:[self password] ]; |
|---|
| 355 | [tpobj setWeblogID:[self parseId:[[token attributeForName:@"href"] stringValue]]]; |
|---|
| 356 | [tpobj setWeblogTitle:[[token attributeForName:@"title"] stringValue]]; |
|---|
| 357 | [tpobj setWeblogURL:[[token attributeForName:@"href"] stringValue]]; |
|---|
| 358 | [tpobj discoverCategories]; |
|---|
| 359 | // TODO: Enable this once the functionality is complete. |
|---|
| 360 | // [tpobj getComments]; |
|---|
| 361 | [weblogs addObject:tpobj]; |
|---|
| 362 | [self setHasWeblog:YES]; |
|---|
| 363 | } |
|---|
| 364 | // [self appNotify:[NSString stringWithFormat:@"File '%@' has been sent", [client filename]] title:@"File Uploaded"]; |
|---|
| 365 | } |
|---|
| 366 | |
|---|
| 367 | - (void) discoverGalleries { |
|---|
| 368 | TypePadAtomAPI *client = [[[TypePadAtomAPI alloc] init] autorelease]; |
|---|
| 369 | [client setDataarg:@""]; |
|---|
| 370 | [client setAuth:[self username] pass:[self password]]; |
|---|
| 371 | [client newpost:@"5" args:nil]; |
|---|
| 372 | NSXMLDocument *xmlDoc = [[NSXMLDocument alloc] initWithXMLString:[client resdata] options:(NSXMLNodePreserveWhitespace|NSXMLNodePreserveCDATA) error:nil]; |
|---|
| 373 | NSArray *nodes = [xmlDoc nodesForXPath:@"/feed/link[@rel=\"service.post\"]" error:nil]; |
|---|
| 374 | int arrayCount = [nodes count]; |
|---|
| 375 | int i = 0; |
|---|
| 376 | for (i = 0; i < arrayCount; i++) { |
|---|
| 377 | NSXMLElement *token = [nodes objectAtIndex:i]; |
|---|
| 378 | TypePadGallery *tpobj = [[TypePadGallery alloc] init]; |
|---|
| 379 | [tpobj setGalleryID:[self parseId:[[token attributeForName:@"href"] stringValue]]]; |
|---|
| 380 | [tpobj setGalleryTitle:[[token attributeForName:@"title"] stringValue]]; |
|---|
| 381 | [tpobj setGalleryURL:[[token attributeForName:@"href"] stringValue]]; |
|---|
| 382 | [galleries addObject:tpobj]; |
|---|
| 383 | [self setHasGallery:YES]; |
|---|
| 384 | } |
|---|
| 385 | // [self appNotify:[NSString stringWithFormat:@"File '%@' has been sent", [client filename]] title:@"File Uploaded"]; |
|---|
| 386 | } |
|---|
| 387 | |
|---|
| 388 | - (void) getComments:(NSString *) blogId { |
|---|
| 389 | |
|---|
| 390 | } |
|---|
| 391 | |
|---|
| 392 | #pragma mark - |
|---|
| 393 | |
|---|
| 394 | - (NSString *) parseId:(NSString *)tmp { |
|---|
| 395 | NSArray *lines = [tmp componentsSeparatedByString:@"="]; |
|---|
| 396 | return [lines objectAtIndex:1]; |
|---|
| 397 | } |
|---|
| 398 | |
|---|
| 399 | @end |
|---|