URLCredential.m 843 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // Credentials.m
  3. // iOS-URLDownloader
  4. //
  5. // Created by Kristijan Sedlak on 7/21/11.
  6. // Copyright 2011 AppStrides. All rights reserved.
  7. //
  8. #import "URLCredential.h"
  9. #pragma mark -
  10. @implementation URLCredential
  11. @synthesize username;
  12. @synthesize password;
  13. @synthesize persistance;
  14. #pragma mark General
  15. - (void)dealloc
  16. {
  17. //[username release];
  18. //[password release];
  19. //[super dealloc];
  20. }
  21. - (id)initWithDefaults
  22. {
  23. if(self == [super init])
  24. {
  25. self.username = nil;
  26. self.password = nil;
  27. self.persistance = NSURLCredentialPersistenceForSession;
  28. }
  29. return self;
  30. }
  31. + (id)credentialWithUsername:(NSString *)user andPassword:(NSString *)pass
  32. {
  33. URLCredential *credential = [[URLCredential alloc] initWithDefaults];
  34. credential.username = user;
  35. credential.password = pass;
  36. return credential;
  37. }
  38. @end