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];
精彩评论