开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜