3

While trying to learn Objective C from a book, I'd like to be able to run some code snippets like...

NSString *str = @"Hello, world!";
NSLog(@"Retain count is %d", [str retainCount]);

In Ruby I'd just put this in an snippet.rb file and run ruby snippet.rb from the terminal. JavaScript has jsfiddle.net. Is there an equally easy way to do this with objective c?

8
  • retainCount? Really? :) Commented Jan 2, 2013 at 22:41
  • This looks like a duplicate of stackoverflow.com/questions/5303217/… Commented Jan 2, 2013 at 22:44
  • @bbum book is teaching memory management Commented Jan 2, 2013 at 22:44
  • 1
    Then throw it away and get a better one. Commented Jan 2, 2013 at 22:49
  • 1
    @Kitsune thanks, I'm just getting an overview of the environment now. However, I thought memory management was now taken care of by ARC so I wouldn't even have to think about it once I got into more of the nitty gritty Commented Jan 2, 2013 at 22:56

1 Answer 1

6

If you're on a Mac there's the handy CodeRunner. It's $9.99 on the App Store but to me it was worth every penny.

Sign up to request clarification or add additional context in comments.

6 Comments

is this just an ordinary code editor? looks like it to me...should I maybe see if there's an extension for my current editor (Sublime), or is there something more to CodeRunner that I should be aware of...
Code Runner let's you type a short snippet in a language of your choice and compiles, links and runs it. It prints the console output and lets you type input to stdin.
+1 coderunner is great. Before that I had dummy Xcode projects and unit tests all over the place.
has anyone used it on Mountain Lion?
@NikolaiRuhe saw a bad review about it by someone using Mountain Lion
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.