Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 11th, 2012  |  syntax: None  |  size: 1.14 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // ===========================================
  2. // I feel so much more comfortable with
  3. // Obj-C instead of PHP. Of course, that's
  4. // probably because I just spent 10 weeks
  5. // learning Obj-C.
  6. //
  7. // Copyright ©, 2011 @CornDoggyRob
  8. // DON'T STEAL MY SHIT BITCHES!
  9. // ===========================================
  10.  
  11. #import <Foundation/Foundation.h>
  12.  
  13. // Interface =================================
  14. @interface MyObject: NSObject {
  15.         NSString *myStringVar;
  16.         NSString *myOtherStringVar;
  17. }
  18.  
  19. - (id)setupMyStrings:(NSString *)someString;
  20. @end
  21.  
  22.  
  23. // Implementation ============================
  24. @implementation MyObject
  25.  
  26. - (id)setupMyStrings:(NSString *)someString {
  27.         myStringVar = @"My String var passed to NSLog is:";
  28.         myOtherStringVar = @"Here's another string.";
  29.         NSLog(@"\n%@ \"%@\"\n%@", myStringVar, someString, myOtherStringVar);
  30. }
  31.  
  32. @end
  33.  
  34.  
  35. // THE FUCKIN CODE! ==========================
  36. int main (int argc, const char * argv[]) {
  37.         NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  38.         MyObject *theObject = [[MyObject alloc] init];
  39.         [theObject setupMyStrings:@"Rob is cool"];
  40.        
  41.         [theObject release];
  42.         [pool drain];
  43.         return 0;
  44. }