Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > Mac OS X Development Forums > Objective-C, Python, Ruby Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-19-2011, 03:49 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 57
ignazioc is on a distinguished road
Question evalutate string with obj-c

Hi,
i have a string like "A < 30 => B = 40"
I want to evaluate this string in my program.
I can split this string in two pieces..."A < 30" and "B = 4"
There is a way to evaluate these strings?
I need something like
Code:
if ( eval(@"A < 30") ) {
    eval(@"B = 4");
}
I know that obj-c isn't a scripting language..but if can i evaluate stringByEvaluatingJavaScriptFromString...maybe can i write these strings in javascript?
ignazioc is offline   Reply With Quote
Old 04-08-2012, 03:51 PM   #2 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: London/Peterborough
Posts: 562
QuantumDoja is on a distinguished road
Default

Would the strings always be Variable ~ Operator ~ number/variable?
If so you could split them on the space, and make some sort of state machine with dictionaries.
QuantumDoja is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 493
13 members and 480 guests
AlanFloyd, andyzaharia, AppsBlogger, David-T, HemiMG, iAppDeveloper, imac74, Jaxen66, lovoyl, Paul Slocum, tiendung2992, unicornleo, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,684
Threads: 94,131
Posts: 402,932
Top Poster: BrianSlick (7,990)
Welcome to our newest member, tiendung2992
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:17 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0