Delegate methods described on lines 76 and 85 are not the selectors
checked on lines 305 and line 302, but are the methods actually called
on the delegate on lines 195 and 225. This fix updates the method
selectors checked on the delegate, to match those defined and called
within the CPKeyedArchiver class.
Fixes#2679
This new warning adds a lot of warnings in the Cappuccino frameworks. I have turned off
the warning in the Jakefiles when compiling most of the Cappuccino frameworks. But it is
on as default for any user projects.
So there is also a new feature to turn off/on warnings as a compiler flag.
These flags are (all flags are on as default):
-Wunused-but-set-variable Warning when a local variable is never read.
-Wshadow-ivar Warning when a local variable is shadowing an instance variable for the class.
-Wcreate-global-inside-function-or-method Warning when creating a global variable inside a function or method.
-Wunknown-class-or-global Warning when a class or global variable is not known.
-Wunknown-ivar-type Warning when the type for an instance variable is not known.
To turn off a flag add a 'no-' prefix. Example: -Wno-unused-but-set-variable
For an example how to use it in a Jakefile please look at the Jakefiles in this commit.
An example:
var array = @[ @{@"Name": @"1"},
@{@"Name": @"2", @"approveTime": @"Now"}
];
var predicate = [CPPredicate predicateWithFormat:@"approveTime != nil"];
CPLog(@"result: %@", [array filteredArrayUsingPredicate:predicate]); // result: <empty array>
If I run this in Cappuccino I get an empty array
If I run it in Cocoa on a Mac I get:
result: (
{
Name = 2;
approveTime = Now;
}
This pull request adds a kvoValueForKey: method used by _CPKVOForwardingObserver for getting values.
The default action is to just return the valueForKey value.
Override this method if you want any other behavior.
It can be used to just return nil if you are implementing a lazy load behavior on a class.
It can allow a combined binding to observe this object without trigger any lazy loading.
On line 51 of CPProxy, `class_getInstanceMethod` is called with the
variable `aSelector`, but this variable does not exist in the
context, but a variable named `selector` does. This fix changes the
method parameter from `selector` to `aSelector` to match the parameter
used within the method.
This allows us to inline the message send function in DEBUG mode. This is great when stepping into a method in the debugger as the message send function is not a separate function. Also the stack traces in the debugger is much more compact as the message send function is not there.