Fixed: [pasteboard declareTypes:… owner:nil]; would emit a warning.

Without this fix, declaring a type with a nil owner would cause a "DEPRECATED: object cannot be nil" warning to be issued.

This fix now allows a nil owner without warning.
This commit is contained in:
Alexander Ljungberg
2013-05-14 14:44:00 -07:00
parent f2d9ef7720
commit 6701117945
+7 -4
View File
@@ -191,10 +191,12 @@ var CPPasteboards = nil,
_owners = @{};
_provided = @{};
var count = _types.length;
while (count--)
[_owners setObject:anOwner forKey:_types[count]];
if (anOwner)
{
var count = _types.length;
while (count--)
[_owners setObject:anOwner forKey:_types[count]];
}
if (_nativePasteboard && shouldUpdate)
{
@@ -205,6 +207,7 @@ var CPPasteboards = nil,
_nativePasteboard.declareTypes_(nativeTypes);
_changeCount = _nativePasteboard.changeCount();
}
return ++_changeCount;
}