Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old Feb 11, 2013, 10:54 PM   #1
hego555
macrumors newbie
 
Join Date: Aug 2008
Creating Object From String

I am new to Obj-C and as my first project I decided to make a Mac version of a program I had made before in C#

Basically the program is a counter or score keeper or whatever you want to call it!

There are 9 + and - buttons each pair connected to a label

So instead of having 18 Methods I made 2 which work dynamically

Now I am trying to do the same thing in Obj-C

Here is my code

Code:
NSString *which = "L1"; //Label 1
NSTextField *label = (NSTextField *)NSClassFromString(which)]);
I get a Expected identifier error, I do not know really what to do!

Thank You!
hego555 is offline   0 Reply With Quote

 
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump


All times are GMT -5. The time now is 04:50 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC