ios,objective-c,ipad,core-data,nsstringencoding
This will generate the random key NSTimeInterval today = [[NSDate date] timeIntervalSince1970]; NSString *intervalString = [NSString stringWithFormat:@"%f", today]; NSDate *date = [NSDate dateWithTimeIntervalSince1970:[intervalString doubleValue]]; NSDateFormatter *formatter=[[NSDateFormatter alloc]init]; [formatter setDateFormat:@"yyyyMMddhhmm"]; NSString *strdate=[formatter stringFromDate:date]; ...
ios,objective-c,nsstringencoding,char-pointer,ios8.2
stringWithUTF8String is expecting a NUL terminated buffer, but your NSData is not NUL terminated. In your example your NSData contains 7 bytes, and the value you are expecting is also 7 characters. This may work occasionally when there happens to be a NUL following the memory in your NSData, but...
nsstring,ascii,nsdata,nsstringencoding
It's a binary file. To read it, you find the documentation for the file format, then you parse it. Trying to throw it all into an NSString* seems absolutely pointless.