Answer the question
In order to leave comments, you need to log in
Why is a variable removed in objective C?
Hello.
I have little experience in iPhone programming, so the answer can be quite simple, but several hours of googling and stackoverflow did not bring the desired result.
The application uses the library and works as follows.
Calling a method from a library. This method makes a request to the API and returns the result. The application then works with this result.
The result is also cached in the library.
Here are code examples:
calling a method from a lib
[[DataCache sharedInstance] getData:accessKey onSuccess:^(DataStruct *dataStruct) {
dispatch_async(dispatch_get_main_queue(), ^{
[dataStruct logUrl]; // метод из одной строки: NSLog(@"url: %@", _url);
// всякий другой код
});
} onError:^{
}];
// в конструкторе класса DataCache
_mediaInfoCache = [[NSMutableDictionary alloc] init];
// в функции получения данных
NSMutableDictionary *record = [[NSMutableDictionary alloc] init];
[record setObject:dataStruct forKey:@"dataStruct"];
[record setObject:[NSDate date] forKey:@"date"];
[_mediaInfoCache setObject:record forKey:targetName];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question