iPhone SDK. How to assign NSString to UILabel text ?
- by Del
If I have a class/object like this
#import <Foundation/Foundation.h>
@interface anObject : NSObject {
NSString *aProp;
}
@property NSString aProp;
@end
and in the cellForRowAtIndexPath method i want to assign one of the string values from its properties to a uilabel of a tableviewcell, how do i do it?
I've tried this but it doesn't work
[[cell topLabel] setText:(NSString *)anObject.aProp];
Putting a breakpoint on the above line and inspecting it, the debugger says "variable is not a CFString
Casting the property to a CFString doesnt work
Modifying the class and declaring the property as a CFStringRef doesnt work either