Thr 07/21/16
1) How to use a storyboard for single app controller.
I met a problem when decided to use static cells. They can't be implemented in .xib files, but only in .storyboard. Due to get over this you should do next:
- Create storyboard file and UITableViewController in his workspace.
- Choose class and ID. Where class is a custom UITableViewController class and ID is custom string.
- In parent ViewController use this code:
UIStoryboard *appSettingsStoryboard = [UIStoryboard storyboardWithName:@"NKVAppSettings" bundle:nil];NKVSettingsTVC *appSettingsTVC = [appSettingsStoryboard instantiateViewControllerWithIdentifier:@"appSettingsID"]; [self.navigationController pushViewController:appSettingsTVC animated:YES];
2) Invisible elements in UITableViewCells
It's very interesting, that when you use UITableViewCell class's elements (like textLabel) and Custom inherited UITableViewCell's class elements.
So you should or use only basic UITableViewClass's elements or use your own, but not them together.
3) How to get and clear ios cache.
For storing images i use SDWebImage. So here is the code:
NSUInteger imagesCashe = sharedCache.getSize;
NSUInteger nsurlCache = [NSURLCache sharedURLCache].currentDiskUsage;
NSUInteger cacheSize = (imagesCashe + nsurlCache) / 1000 / 1000;
self.appSettingsCashSizeLabel.text = [NSString stringWithFormat:@"%lu %@",(unsigned long)cacheSize, "Mb"];
Clear:
SDImageCache *imageCache = [SDImageCache sharedImageCache];
[imageCache clearMemory];
[imageCache clearDisk];
[[NSURLCache sharedURLCache] removeAllCachedResponses];
[imageCache clearMemory];
[imageCache clearDisk];
[[NSURLCache sharedURLCache] removeAllCachedResponses];
4) How to hide separator inset (lines between every cell)
Комментарии
Отправить комментарий