Questions tagged [nscache]

NSCache is a cache-related class included in Apple's Foundation framework.

NSCache is similar to NSMutableDictionary, with the differences being:[1]
1. It is guaranteed to be thread-safe.
2. It is much slower to access.
3. It may throw out objects from time to time. You can set costs and limits, but they're not guaranteed to be followed.
4. It is not toll-free bridged to anything in CoreFoundation.
5. You can't query the number of objects that are in the cache.
6. You can't enumerate a cache.

154 questions
0
votes
2 answers

UIImageView+AFNetworking get UIImage for URL

I am using UIImageView+AFNetworking and am wondering if there is a way to get the UIImage from the cache? It seems like there should be a method to return the UIImage based on the URL. Possible?
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
0
votes
2 answers

Using NSCache as data source for pickerview may crash

I have some data that was originally stored in sqlite and will be loaded to NSCache when first used. I copy the data from NSCache to a pickerview object and use the data to generate pickerview("retain" in the object). However, a small amount of…
benck
  • 2,034
  • 1
  • 22
  • 31
0
votes
1 answer

How to use NSCache with CoreData

I have developed a project, where a user draws a image on a canvas, I store it in the file using CoreData, I have one-to-many relationship called folder-to-files. So here all are images. I retrive the images from files , resize according to my table…
0
votes
0 answers

Encrypt or protect cached files in the application documents, to be opened only by the application

I'm using EGOCache to cache NSData and then reread the NSData into NSDictionary, so when I checked the iPhone Simulator file to see if the data is protected!! I found that I can open it easily!. So what I am asking about, is there any way to protect…
M.Alatrash
  • 1,270
  • 1
  • 12
  • 30
0
votes
1 answer

image not showing in UIImage from cached data

I cant possibly get the image that i parsed from the XML to show on my UIImageView using the code below. Am I doing something wrong because I checked it using NSLog to show if there is a link and apparently there is. NSString *imageURL =…
Ace Munim
  • 325
  • 3
  • 18
0
votes
1 answer

iOS Saving User Configuration

I am working with an iOS app that will require the user to configure part of the app and that configuration must be saved in the event the user turns on/off a part of the app. Once the app is backgrounded, the users-configuration must be removed for…
Brian
  • 723
  • 1
  • 8
  • 26
0
votes
2 answers

confusion in data storage into nscache

i know that im doing a mistake here coz i cant run the project im trying to build and also what im trying to do here is to get a parsed data from an xml then save it into a an nsdata and then put all those data into a cache so when i run my project…
Ace Munim
  • 325
  • 3
  • 18
0
votes
1 answer

Differences in various NSURLRequest CachePolicies?

How Does using various cache policies(NSURLRequestCachePolicy) improve download performance?Which are the best solutions to use in a sample download app?
sams58
  • 45
  • 8
0
votes
1 answer

UIView in NSCache being overriden

I have a UIView that contains drop shadows and corners which I am loading four of in my UIViewController and I am seeing a performance hit when the screen loads. Since I am using the same white background with shadows and corner radii I figured I…
Flea
  • 11,176
  • 6
  • 72
  • 83
0
votes
1 answer

Can I save the downloaded files to NSCacheDictionary in iphone?

I am downloading some mp3 files through my application using NSURLConnection. Actually where can I save the downloaded file. Someone says that saving in to NSDocumentDirectory will lead to app rejection. Can I save the file to NSCacheDictionary and…
neerajPK
  • 293
  • 1
  • 4
  • 17
0
votes
1 answer

NSCache, does removeAllObjects release the memory usage? I'm using ARC

I'm using ARC and NSCache which is created and stored on my app delegate. Then I call it from the controllers trough the app delegate. The NSCache stores images as they are loaded from an url and the memory usage goes up really quick. When I check…
clopez
  • 4,372
  • 3
  • 28
  • 42
0
votes
3 answers

application remains previous state when enter from background in ipad?

i have noticed that my ipad application remains in previous state (state when i closed the app) when it coming from background. i have checked the plist and delegate methods fro this problem. actually i have a web app that uses UIWebView . i cant…
neerajPK
  • 293
  • 1
  • 4
  • 17
0
votes
1 answer

How do I create a copy of a set of uiimages?

So this may be sort of difficult to explain, but I'll do my best. This problem might take a few steps to solve too. This code appears in a tableviewcell, so it's ran every time the cell comes on screen: [cell.cellContent.thumbnails…
Andrew
  • 15,935
  • 28
  • 121
  • 203
0
votes
2 answers

NSCache does not work

I'm writing an app that needs store a few images in cache. I'm trying to do it with NSCache and the code seems to be well but don't save the images in cache. I have this code: cache is global, declared in .h: NSCache *cache; -(UIImage…
Asneroll
  • 155
  • 1
  • 3
  • 10
-1
votes
1 answer

Swift custom struct in NSCache

How can I use a custom struct in NSCache? When I add the User struct to NSCache, I get an error like the image below. Cache Store: class QuestionCacheStore { let cache = NSCache() } Error: 'NSCache' requires that 'User' be a…
Ufuk Köşker
  • 1,288
  • 8
  • 29
1 2 3
10
11