开发者

Copy NSdate Object

I am calling one function from an开发者_Go百科other view controller which is passing NSDate object to that function which is another view controller, but At that function passed date is not goin to be assigned/ copying to another local NSDate object.

Here is my code.

 - (void)setDefaultCalendarDate:(NSDate *)aDate {

        self.backgroundColor = [UIColor clearColor];
        selectedNSDate = [aDate copy]; 
//selectedNSDate=aDate;

How to copy aDate into selectedNSDate? When I take NSlog for it I get null


You're almost certainly getting nil because aDate is already nil, so copying it gets you nothing.

Try NSLog(@"%@", aDate) -- what does it say?


selectedNSDate = aDate surely? or if needed selectedNSDate = [aDate retain];

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜