Re: How to use the NSCache

2011-05-15 Thread Nick Zitzmann
On May 15, 2011, at 11:50 PM, Leon Qiao wrote: > Have you ever used the NSCache? Yes. > I'm a little confused on how to use it. I > want to make a list to hold some images in memory. > And the memory overload is a big problem. So I wish I could use the NSCache > to > manage the memory. NSCache

How to use the NSCache

2011-05-15 Thread Leon Qiao
Dear all, Have you ever used the NSCache? I'm a little confused on how to use it. I want to make a list to hold some images in memory. And the memory overload is a big problem. So I wish I could use the NSCache to manage the memory. Please send me a demo or code fragment if you have. Thanks a lot

Re: CoreData mapping two different objects to same entity?

2011-05-15 Thread Kyle Sluder
On Sun, May 15, 2011 at 6:01 PM, William Squires wrote: > Is it possible to map two different objects (the ivars are the same, just > some validation methods are different) to the same entity? You mean "same managed object," not "same entity." Which, when you use the correct terminology, makes i

Why are properties access through NSURLProtocol class method rather than NSURLRequest instance method?

2011-05-15 Thread Larry Campbell
Seems odd to me that setting and getting properties of an NSURLRequest involve an NSURLProtocol class method: +[NSURLProtocol setProperty:forKey:inRequest:] rather than what seems to me the much more straightforward: -[NSMutableURLRequest setProperty:forKey:] Is there a reason for this

CoreData mapping two different objects to same entity?

2011-05-15 Thread William Squires
Is it possible to map two different objects (the ivars are the same, just some validation methods are different) to the same entity? Here's what I have: I want to make a view in which the player 'rolls up' a new player-character. This object has certain ivars (and @property declarations) that m

Re: Delegate & Notification

2011-05-15 Thread Michael Babin
On May 15, 2011, at 5:31 PM, Bing Li wrote: > An object, WorkingApp, prints a line and posts a notification as follows. > >import "WorkingApp.h" > >@implementation WorkingApp > >- (void) Print >{ >NSLog(@"I am doing a tough job!"); >[[NSNotificationCenter default

Delegate & Notification

2011-05-15 Thread Bing Li
Dear all, I am learning how to use delegate & notification. An object, WorkingApp, prints a line and posts a notification as follows. import "WorkingApp.h" @implementation WorkingApp - (void) Print { NSLog(@"I am doing a tough job!"); [[NSNotificationCenter defa

Re: Tab Bar Application

2011-05-15 Thread Fritz Anderson
On 14 May 2011, at 8:48 PM, koko wrote: > Given a Tab Bar Application with n Tab Bar Items what is the recommended > pattern for the Views associated with each Tab Bar Item to communicate > between themselves? Views don't communicate with each other under the MVC pattern. They communicate only

Re: Silly, can I use @max to get the object with the latest date?

2011-05-15 Thread Gustavo Pizano
Hello Evadne I tried this one out it worked... Will try yours also NSInteger vNumber = 1; NSSet * versions = [self valueForKey:@"toVersions"]; if(!versions || [versions count] == 0) return vNumber; else{ NSDate * d = [versions valueFor

Re: Silly, can I use @max to get the object with the latest date?

2011-05-15 Thread Evadne Wu
Hi Gustavo, How about setting the sort descriptor’s ascending to NO, and limit the number of fetched objects to one? Something like this…? [request setSortDescriptors:[NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"date" ascending:NO]]]; // descending = arranged from

Silly, can I use @max to get the object with the latest date?

2011-05-15 Thread Gustavo Pizano
Hello all. I have a Entity Athat has a to-many relationship. to B Now I need to get the latest B of A. I was reading NSFetchRequest, and NSPredicate, for NSPredictate I could use something like predicate = [NSPredicate predicateWithFormat:@"birthday > %@", referenceDate]; filteredArra