Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ericentin/objc-eval
Via gcc and xcode, compile simple objective-c code provided as an NSString at runtime, and execute it within the context of the same, running, program.
https://github.com/ericentin/objc-eval
Last synced: 2 months ago
JSON representation
Via gcc and xcode, compile simple objective-c code provided as an NSString at runtime, and execute it within the context of the same, running, program.
- Host: GitHub
- URL: https://github.com/ericentin/objc-eval
- Owner: ericentin
- Created: 2010-02-22T03:34:13.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2010-08-04T04:16:40.000Z (over 14 years ago)
- Last Synced: 2024-05-09T21:32:55.535Z (8 months ago)
- Language: Objective-C
- Homepage: http://ericentin.com
- Size: 169 KB
- Stars: 18
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.mdown
Awesome Lists containing this project
- awesome - objc-eval - Via gcc and xcode, compile simple objective-c code provided as an NSString at runtime, and execute it within the context of the same, running, program. (etc)
README
objc-eval
=========objc-eval is ruby-like eval ("eval? what's that?!" read [this](http://blog.grayproductions.net/articles/eval_isnt_quite_pure_evil "eval() Isn't Quite Pure Evil")) for objective-c. Is it a good idea? I don't know. If you have to ask, it's probably not. It will, however, satisfy my (morbid) curiosity about whether or not it's possible. It carries along all the usual security concerns of any language's "eval." Make sure you trust the source of the code that is about to be compiled and executed with whatever privileges the program you used objc-eval in has.
Usage
=====
Add to your project as you would any framework. You can either asynchronously evaluate with a delegate, or synchronously evaluate. Did I mention how stupid this is yet?Example
=======
`OEEvaluation *evaluation = [OEEvaluation evaluationWithCode:@"return @\"Hello World!\";" delegate:nil];
NSLog([evaluation evaluateSynchronously]);`