Guest User

Untitled

a guest
Oct 21st, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. @class OnlineTextPoster;
  2.  
  3. @protocol OnlineTextPosterDelegate<NSObject>
  4.  
  5. @optional
  6. - (void)onlineTextPoster:(OnlineTextPoster *)poster postedToURL:(NSURL *)textURL;
  7. - (void)onlineTextPoster:(OnlineTextPoster *)poster failedWithError:(NSError *)theError;
  8.  
  9. @end
  10.  
  11. /**
  12. * This is an abstract class for posting text to an online
  13. * website.
  14. */
  15. @interface OnlineTextPoster : NSObject {
  16. id<OnlineTextPosterDelegate> delegate;
  17. }
  18.  
  19. /**
  20. * The delegate of the online text poster. This will be called back upon
  21. * when a post successfully finishes, or a post fails.
  22. * The delegate is retained because OnlineTextPosted will retain itself when a background
  23. * thread is started. This means that even if the delegate releases the text poster,
  24. * it will still be called upon when a post finishes.
  25. */
  26. @property (nonatomic, retain) id<OnlineTextPosterDelegate> delegate;
  27.  
  28. /**
  29. * Creates a new text poster with text and a language.
  30. * @param theText The text to post to the text poster.
  31. * @param language An object that carries information to the text poster
  32. * was to which programming/text language the posted text is written in.
  33. */
  34. - (id)initWithText:(NSString *)theText language:(id)language;
  35.  
  36. /**
  37. * Begins an asynchronous post to the text poster site.
  38. * @return YES if the background post was initiated successfully. NO on
  39. * any sort of failure or if a background thread is already running.
  40. */
  41. - (BOOL)postInBackground;
  42.  
  43. @end
Add Comment
Please, Sign In to add comment