i want to read the data stored in icloud in my application,but getting exception in the following method
-(BOOL)loadFromContents:(id)contents ofType:(NSString *)typeName error:(NSError **)outError
{
if (contents != nil && [contents length]>0)
{
NSString * pString = [[NSString alloc] initWithData:contents
encoding:NSUTF8StringEncoding];
}
}
the exception is coming while converting contents into NSString. it causes application crash.
i found my mistake , i was doing a mistake while reading data from icloud ....
previously to read data i have used UIDocument class "readFromURL:url error:&error" method ,
but now i replaced this call with following method .
[documentclassObj openWithCompletionHandler:^(BOOL success) {
}];
now it's working fine .....