macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

CFSetGetValues

void  CFSetGetValues ( 
       CFSetRef   theSet , 
       const void **   values );

解説

セットの値を得ます。

返り値

引数

( CFSetRef )theSet
( const void ** )values

クラス

CFSet

Function

使用可能

10.0

参照

例文

CFIndex             clientCount;
	CFIndex             clientIndex;
	ClientState **      allClients;

    if (gClients != NULL) {
		// Can't use CFSetApplyFunction because the ClientDestroy modifies 
		// the gClients set.
		
		clientCount = CFSetGetCount(gClients);
		
		allClients = calloc(clientCount, sizeof(ClientState *));
		if (allClients == NULL) {
			fprintf(stderr, "CFLocalServer: Could not clean up clients because we couldn't allocate memory.\n");
		} else {
			CFSetGetValues(gClients, (const void **) allClients);
			
			for (clientIndex = 0; clientIndex < clientCount; clientIndex++) {
				fprintf(stderr, "CFLocalServer: Client %p killed because we're quitting.\n", allClients[clientIndex]);

				ClientDestroy( allClients[clientIndex] );
			}
		}

		free(allClients);
		
		CFRelease(gClients);
		gClients = NULL;
    }