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

Similar Threads
thread Thread Starter Forum Replies Last Post
Resolved: How do I convert an NSData object to an NSDictionary object, and vice versa? moonman239 iPhone/iPad Programming 6 May 2, 2014 01:17 PM
Format string is not a string literal. larswik Mac Programming 5 Jan 17, 2014 10:45 PM
Resolved: Best way to access all properties of an object whose names begin with a string? moonman239 iPhone/iPad Programming 7 Nov 18, 2013 03:04 PM
Search a string for a String of a specific format. ncaissie iPhone/iPad Programming 19 Nov 15, 2013 10:42 AM
Creating a String with multiple lines LT21j iPhone/iPad Programming 5 Jun 6, 2013 09:50 AM

Forum Jump

All times are GMT -5. The time now is 05:29 AM.

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

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