Variable is not a CFString how to remove this
I have value which i am storing in the var it gives error
Date*aDate=[appDelegate.dates objectAtIndex:indexPath.row];
NSInteger test=aDate.date;
cell.text=test;
This is the Date class
Date.h
@interface Date : NSObject {
NSInteger *date;
}
@property(nonatomic) NSInteger *date;
@end
Date.m
#import "Date.h"
@implementation Date
@synthesize date;
-(id)init{
self=[super init];
}
- 开发者_开发百科(id)initWithDictionary:(NSDictionary*) dict {
self.date = [dict valueForKey:@"date"];
return self;
}
@end
Do like this.
Date*aDate=[appDelegate.dates objectAtIndex:indexPath.row];
NSInteger test=aDate.date;
cell.textLabel.text= [NSString stringWithFormat:@"%d",test];
Since u cannot set integer to cell label.
精彩评论