Minor documentation tweaks

This commit is contained in:
rfm 2023-10-30 16:56:05 +00:00
parent 44dc5cef3d
commit e027ff8585
9 changed files with 57 additions and 38 deletions

View file

@ -56,21 +56,24 @@ extern "C" {
* in assuming that the receiver can handle it.
*/
@protocol NSObject
/**
* Returns the class of the receiver. If the receiver is a proxy, then this
* may return the class of the proxy target. Use -isProxy to determine whether
* the receiver is a proxy. If you wish to find the real class of the
* receiver, ignoring proxies, then use object_getClass().
* receiver, ignoring proxies, then use "object_getClass()".
*/
- (Class) class;
/**
* Returns the superclass of receiver's class. If the receiver is a proxy,
* then this may return the class of the proxy target. Use -isProxy to
* determine whether the receiver is a proxy. If you wish to find the real
* superclass of the receiver's class, ignoring proxies, then use
* class_getSuperclass(object_getClass()).
* "class_getSuperclass(object_getClass())".
*/
- (Class) superclass;
/**
* Returns whether the receiver is equal to the argument. Defining equality is
* complex, so be careful when implementing this method. Collections such as
@ -89,12 +92,14 @@ extern "C" {
* equal hash values do not imply equality.
*/
- (BOOL) isEqual: (id)anObject;
/**
* Returns YES if the receiver is an instance of the class, an instance of the
* subclass, or (in the case of proxies), an instance of something that can be
* treated as an instance of the class.
*/
- (BOOL) isKindOfClass: (Class)aClass;
/**
* Returns YES if the receiver is an instance of the class or (in the case of
* proxies), an instance of something that can be treated as an instance of the
@ -106,12 +111,14 @@ extern "C" {
* subclass.
*/
- (BOOL) isMemberOfClass: (Class)aClass;
/**
* Returns YES if the receiver is a proxy, NO otherwise. The default
* implementation of this method in NSObject returns NO, while the
* implementation in NSProxy returns YES.
*/
- (BOOL) isProxy;
/**
* Returns a hash value for the object. All objects that are equal *MUST*
* return the same hash value. For efficient storage in sets, or as keys in
@ -124,16 +131,19 @@ extern "C" {
* modified while stored in an unordered collection.
*/
- (NSUInteger) hash;
/**
* Returns the receiver. In a proxy, this may (but is not required to) return
* the proxied object.
*/
- (id) self;
/**
* Performs the specified selector. The selector must correspond to a method
* that takes no arguments.
*/
- (id) performSelector: (SEL)aSelector;
/**
* Performs the specified selector, with the object as the argument. This
* method does not perform any automatic unboxing, so the selector must
@ -141,6 +151,7 @@ extern "C" {
*/
- (id) performSelector: (SEL)aSelector
withObject: (id)anObject;
/**
* Performs the specified selector, with the objects as the arguments. This
* method does not perform any automatic unboxing, so the selector must
@ -149,6 +160,7 @@ extern "C" {
- (id) performSelector: (SEL)aSelector
withObject: (id)object1
withObject: (id)object2;
/**
* Returns YES if the object can respond to messages with the specified
* selector. The default implementation in NSObject returns YES if the
@ -157,16 +169,19 @@ extern "C" {
* forwarding mechanisms.
*/
- (BOOL) respondsToSelector: (SEL)aSelector;
/**
* Returns YES if the receiver conforms to the specified protocol.
*/
- (BOOL) conformsToProtocol: (Protocol*)aProtocol;
/**
* Increments the reference count of the object and returns the receiver. In
* garbage collected mode, this method does nothing. In automated reference
* counting mode, you may neither implement this method nor call it directly.
*/
- (id) retain NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
/**
* Decrements the reference count of the object and destroys if it there are no
* remaining references. In garbage collected mode, this method does nothing.
@ -174,6 +189,7 @@ extern "C" {
* nor call it directly.
*/
- (oneway void) release NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
/**
* Performs a deferred -release operation. The object's reference count is
* decremented at the end of the scope of the current autorelease pool,
@ -185,6 +201,7 @@ extern "C" {
* counting mode, you may neither implement this method nor call it directly.
*/
- (id) autorelease NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
/**
* Returns the current retain count of an object. This does not include the
* result of any pending autorelease operations.
@ -197,11 +214,13 @@ extern "C" {
* occasionally be useful for debugging.
*/
- (NSUInteger) retainCount NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
/**
* Returns the description of the object. This is used by the %@ format
* specifier in strings.
*/
- (NSString*) description;
/**
* Returns the zone of the object.
*/

View file

@ -131,7 +131,7 @@ GS_EXPORT_CLASS
* This is the method which actually performs the operation ...
* the default implementation does nothing.<br />
* You MUST ensure that your implemention of -main does not raise any
* exception or call [NSThread-exit] as either of these will terminate
* exception or call [NSThread+exit] as either of these will terminate
* the operation prematurely resulting in the operation never reaching
* the -isFinished state.<br />
* If you are writing a concurrent subclass, you should override -start
@ -139,7 +139,7 @@ GS_EXPORT_CLASS
*/
- (void) main;
/** Returns the priority set using the -setQueuePriority method, or
/** Returns the priority set using the -setQueuePriority: method, or
* NSOperationQueuePriorityNormal if no priority has been set.
*/
- (NSOperationQueuePriority) queuePriority;

View file

@ -147,7 +147,7 @@ GS_EXPORT_CLASS
/**
* Produces a sorted array using the mechanism described for
* [NSMutableArray-sortUsingDescriptors:]
* [NSMutableArray(NSSortDescriptorSorting)-sortUsingDescriptors:]
*/
- (GS_GENERIC_CLASS(NSArray, ElementT) *) sortedArrayUsingDescriptors: (NSArray *)sortDescriptors;
@ -174,7 +174,7 @@ GS_EXPORT_CLASS
@interface GS_GENERIC_CLASS(NSSet, ElementT) (NSSortDescriptorSorting)
/**
* Produces a sorted array from using the mechanism described for
* [NSMutableArray-sortUsingDescriptors:]
* [NSMutableArray(NSSortDescriptorSorting)-sortUsingDescriptors:]
*/
- (GS_GENERIC_CLASS(NSArray, ElementT) *) sortedArrayUsingDescriptors: (NSArray *)sortDescriptors;
@end

View file

@ -49,7 +49,7 @@ extern "C" {
* User defaults domain for process arguments. Command-line arguments
* (key-value pairs, as in "-NSFoo bar") are placed in this domain.<br />
* Where there is a sequence of arguments beginning with '-', only the
* last one is used (so "-a -b -c d" will produce a single user default
* last one is used (so "-a" "-b" "-c" "d" will produce a single user default
* 'c' with value 'd').<br />
* NB. On OSX the argument "-" means a key consisting of an empty string
* (so you can't use a '-' as a default value), while in GNUstep a "-" is

View file

@ -256,30 +256,30 @@ GSObjCSetVal(NSObject *self, const char *key, id val, SEL sel,
*/
/**
* Deprecated ... use objc_getClassList()
* Deprecated ... use "objc_getClassList()".
*/
GS_EXPORT unsigned int
GSClassList(Class *buffer, unsigned int max, BOOL clearCache);
/**
* GSObjCClass() is deprecated ... use object_getClass()
* GSObjCClass() is deprecated ... use "object_getClass()".
*/
GS_EXPORT Class GSObjCClass(id obj);
/**
* GSObjCSuper() is deprecated ... use class_getSuperclass()
* GSObjCSuper() is deprecated ... use "class_getSuperclass()".
*/
GS_EXPORT Class GSObjCSuper(Class cls);
/**
* GSObjCIsInstance() is deprecated ... use object_getClass()
* in conjunction with class_isMetaClass()
* GSObjCIsInstance() is deprecated ... use "object_getClass()"
* in conjunction with "class_isMetaClass()".
*/
GS_EXPORT BOOL GSObjCIsInstance(id obj);
/**
* GSObjCIsClass() is deprecated ... use object_getClass()
* in conjunction with class_isMetaClass()
* GSObjCIsClass() is deprecated ... use "object_getClass()"
* in conjunction with "class_isMetaClass()".
*/
GS_EXPORT BOOL GSObjCIsClass(Class cls);
@ -290,28 +290,28 @@ GS_EXPORT BOOL GSObjCIsClass(Class cls);
GS_EXPORT BOOL GSObjCIsKindOf(Class cls, Class other);
/**
* GSClassFromName() is deprecated ... use objc_lookUpClass()
* GSClassFromName() is deprecated ... use "objc_lookUpClass()".
*/
GS_EXPORT Class GSClassFromName(const char *name);
/**
* GSNameFromClass() is deprecated ... use class_getName()
* GSNameFromClass() is deprecated ... use "class_getName()".
*/
GS_EXPORT const char *GSNameFromClass(Class cls);
/**
* GSClassNameFromObject() is deprecated ... use object_getClass()
* in conjunction with class_getName()
* GSClassNameFromObject() is deprecated ... use "object_getClass()".
* in conjunction with "class_getName()".
*/
GS_EXPORT const char *GSClassNameFromObject(id obj);
/**
* GSNameFromSelector() is deprecated ... use sel_getName()
* GSNameFromSelector() is deprecated ... use "sel_getName()".
*/
GS_EXPORT const char *GSNameFromSelector(SEL sel);
/**
* GSSelectorFromName() is deprecated ... use sel_getUid()
* GSSelectorFromName() is deprecated ... use "sel_getUid()".
*/
GS_EXPORT SEL
GSSelectorFromName(const char *name);
@ -412,19 +412,19 @@ GS_EXPORT void
GSFlushMethodCacheForClass (Class cls);
/**
* Deprecated .. use class_getInstanceVariable()
* Deprecated .. use "class_getInstanceVariable()".
*/
GS_EXPORT GSIVar
GSCGetInstanceVariableDefinition(Class cls, const char *name);
/**
* Deprecated .. use class_getInstanceVariable()
* Deprecated .. use "class_getInstanceVariable()".
*/
GS_EXPORT GSIVar
GSObjCGetInstanceVariableDefinition(Class cls, NSString *name);
/**
* GSObjCVersion() is deprecated ... use class_getVersion()
* GSObjCVersion() is deprecated ... use "class_getVersion()"
*/
GS_EXPORT int GSObjCVersion(Class cls);

View file

@ -52,7 +52,7 @@ extern "C" {
*/
- (NSComparisonResult) compare: (id)anObject;
/** For backward compatibility only ... use class_isMetaClass() on the
/** For backward compatibility only ... use "class_isMetaClass()" on the
* class of the receiver instead.
*/
- (BOOL) isInstance;

View file

@ -1000,8 +1000,8 @@ GSObjCAddClassOverride(Class receiver, Class override)
* supplied).<br />
* Automatic conversion between NSNumber and C scalar types is performed.<br />
* If type is null and can't be determined from the selector, the
* [NSObject-handleQueryWithUnboundKey:] method is called to try
* to get a value.
* "-handleQueryWithUnboundKey:" method is called (if the object responds to
* that message) to try to get a value.
*/
id
GSObjCGetVal(NSObject *self, const char *key, SEL sel,
@ -1454,8 +1454,8 @@ GSObjCGetValue(NSObject *self, NSString *key, SEL sel,
* supplied).<br />
* Automatic conversion between NSNumber and C scalar types is performed.<br />
* If type is null and can't be determined from the selector, the
* [NSObject-handleTakeValue:forUnboundKey:] method is called to try
* to set a value.
* "-handleTakeValue:forUnboundKey:" method is called (if the object
* responds to that message) to try to set a value.
*/
void
GSObjCSetVal(NSObject *self, const char *key, id val, SEL sel,

View file

@ -853,7 +853,7 @@ static NSNotificationCenter *default_center = nil;
* the object argument is nil).</p>
*
* <p>For the name and object arguments, the constraints and behavior described
* in -addObserver:name:selector:object: remain valid.</p>
* in -addObserver:selector:name:object: remain valid.</p>
*
* <p>For each notification received by the center, the observer will execute
* the notification block. If the queue is not nil, the notification block is
@ -865,15 +865,15 @@ static NSNotificationCenter *default_center = nil;
queue: (NSOperationQueue *)queue
usingBlock: (GSNotificationBlock)block
{
GSNotificationObserver *observer =
[[GSNotificationObserver alloc] initWithQueue: queue block: block];
GSNotificationObserver *observer =
[[GSNotificationObserver alloc] initWithQueue: queue block: block];
[self addObserver: observer
selector: @selector(didReceiveNotification:)
name: name
object: object];
[self addObserver: observer
selector: @selector(didReceiveNotification:)
name: name
object: object];
return observer;
return observer;
}
/**

View file

@ -742,8 +742,8 @@ static inline BOOL timerInvalidated(NSTimer *t)
* <p>There is one run loop per thread in an application, which
* may always be obtained through the <code>+currentRunLoop</code> method
* (you cannot use -init or +new),
* however unless you are using the AppKit and the [NSApplication] class, the
* run loop will not be started unless you explicitly send it a
* however unless you are using the AppKit and the <code>NSApplication</code>
* class, the run loop will not be started unless you explicitly send it a
* <code>-run</code> message.</p>
*
* <p>At any given point, a run loop operates in a single <em>mode</em>, usually