Home > Articles > Home & Office Computing > Mac OS X

This chapter is from the book

4.5 Enumeration

The traditional way of performing enumeration on Foundation collections is via the NSEnumerator. This is a very simple object that responds to a -nextObject message and returns either the next object, or nil if there is no next object. To enumerate a collection using an enumerator, you simply call a method like -objectEnumerator on the collection and then loop sending -nextObject to the returned enumerator until it returns nil.

With 10.5, Apple added a fast enumeration system. This uses a new for loop construct, part of Objective-C 2.0, which handles collections.

A lot of the time, however, you don't need to use enumeration directly at all. You can use something like NSArray's -makeObjectsPerformSelector: method. Listing 4.7 shows an example of all three ways of sending a single message to all objects in an array.

Listing 4.7. The three ways of sending a message to an object in Cocoa. [from: examples/Enumeration/enum.m]

 1| #import <Foundation/Foundation.h>
 2|
 3| @interface NSString (printing)
 4| - (void) print;
 5| @end
 6| @implementation NSString (printing)
 7| - (void) print
 8| {
 9|     fprintf(stderr, "%s\n", [self UTF8String]);
10| }
11| @end
12|
13| int main(void)
14| {
15|     [NSAutoreleasePool new];
16|     NSArray* a =
17|         [NSArray arrayWithObjects: @"this", @"is", @"an", @"array", nil];
18|
19|     NSLog(@"The_Objective-C_1_way:");
20|     NSEnumerator *e=[a objectEnumerator];
21|     for (id obj=[e nextObject]; nil!=obj ; obj=[e nextObject])
22|     {
23|         [obj print];
24|     }
25|     NSLog(@"The_Leopard_way:");
26|     for (id obj in a)
27|     {
28|         [obj print];
29|     }
30|     NSLog(@"The_simplest_way:");
31|     [a makeObjectsPerformSelector: @selector(print)];
32|     return 0;
33| }

Lines 20–24 show how to use an enumerator. This is quite complex and easy to make typos in, so in Étoilé we hide this pattern in a FOREACH macro (which also does some caching to speed things up slightly). A simpler version is shown in lines 26–29, using the fast enumeration pattern. This is both simpler code and faster, which is quite a rare achievement. The final version, on line 31, is even simpler. This is a single line. If you want to send more than one message, or messages with more than one argument, then this mechanism is unavailable.

Running this code, we get

$ gcc -std=c99 -framework Foundation enum.m && ./a.out
2009-01-07 18:06:41.014 a.out[30527:10b] The Objective-C 1 way:
this
is
an
array
2009-01-07 18:06:41.020 a.out[30527:10b] The Leopard way:
this
is
an
array
2009-01-07 18:06:41.021 a.out[30527:10b] The simplest way:
this
is
an
array

4.5.1 Enumerating with Higher-Order Messaging

An additional way of performing enumeration, among other things, was proposed by Marcel Weiher. The mechanism, called higher-order messaging (HOM) uses the proxy capabilities of Objective-C. It adds methods like -map to the collection classes. When these are called, they return a proxy object that bounces every message sent to them to every object in the array.

Listing 4.8 shows a -map method added as a category on NSArray. This is taken from the EtoileFoundation framework, with the Étoilé-specific macros removed. This framework is available under a BSD license, and so you can use it in your own projects if you wish.

Listing 4.8. A example of a map method implemented using higher-order messaging. [from: examples/HOM/NSArray+map.m]

 3| @interface NSArrayMapProxy : NSProxy {
 4|     NSArray * array;
 5| }
 6| - (id) initWithArray:(NSArray*)anArray;
 7| @end
 8|
 9| @implementation NSArrayMapProxy
10| - (id) initWithArray:(NSArray*)anArray
11| {
12|     if (nil == (self = [self init])) { return nil; }
13|     array = [anArray retain];
14|     return self;
15| }
16| - (id) methodSignatureForSelector:(SEL)aSelector
17| {
18|     for (object in array)
19|     {
20|         if([object respondsToSelector:aSelector])
21|         {
22|             return [object methodSignatureForSelector:aSelector];
23|         }
24|     }
25|     return [super methodSignatureForSelector:aSelector];
26| }
27| - (void) forwardInvocation:(NSInvocation*)anInvocation
28| {
29|     SEL selector = [anInvocation selector];
30|     NSMutableArray * mappedArray =
31|         [NSMutableArray arrayWithCapacity:[array count]];
32|     for (object in array)
33|     {
34|         if([object respondsToSelector:selector])
35|         {
36|             [anInvocation invokeWithTarget:object];
37|             id mapped;
38|             [anInvocation getReturnValue:&mapped];
39|             [mappedArray addObject:mapped];
40|         }
41|     }
42|     [anInvocation setReturnValue:mappedArray];
43| }
44| - (void) dealloc
45| {
46|     [array release];
47|     [super dealloc];
48| }
49| @end
50|
51| @implementation NSArray (AllElements)
52| - (id) map
53| {
54|     return [[[NSArrayMapProxy alloc] initWithArray:self] autorelease];
55| }
56| @end

The -map method itself is relatively simple; it just creates an instance of the proxy, associates it with the array, and returns it. You would use this category like this:

[[array map] stringValue];

This would return an array containing the result of sending -stringValue to every element in array. When you send the -stringValue message to the proxy, the runtime calls the -methodSignatureForSelector: method. This is used to find out the types of the method. This implementation simply calls the same method on every object in the array until it finds one which returns a value.

Next, the -forwardInvocation: method will be called. This has an encapsulated message as the argument. The body of this method sends this message to every object in the array and then adds the result to a new array.

Unlike the -makeObjectsPerformSelector:, messages sent to objects using higher-order messaging can have an arbitrary number of arguments. Exactly the same mechanism can be used to implement a variety of other high-level operations on collections, such as folding or selecting.

Although the use of the forwarding mechanism makes this relatively slow, compared with other enumeration mechanisms, the fact that it preserves high-level information in the source code can make it attractive. It results in less duplicated code and code that is easier to write. HOM is used a lot in modern Smalltalk implementations, although the initial implementation was in Objective-C.

Higher-order messaging is not limited to enumeration. It is also used for a wide number of other tasks, including sending messages between threads. We'll look more at how to use it for asynchronous messaging in Chapter 23.

4.5.2 Enumerating with Blocks

OS X 10.6 added blocks, which we looked at in the last chapter, to the C family of languages. Blocks by themselves are quite useful, but their real power comes from their integration with the rest of the Foundation framework. This integration comes from a number of new methods, such as this one on NSArray:

- (void)enumerateObjectsUsingBlock:
        (void (^)(id obj, NSUInteger idx, BOOL *stop))block;

The argument is a block taking three arguments: an object, the index at which that object appears in the array, and a pointer to a boolean value to set if enumeration should stop. We could rewrite the same enumeration example that we used earlier with a block as:

[a enumerateObjectsUsingBlock:
        ^(id obj, NSUInteger idx, BOOL *stop) { [obj print]; } ];

The requirement to put the types of the block arguments inline makes this quite difficult to read, but you could split it up a bit by declaring the block separately and then calling it. In this example, the block doesn't refer to anything other than its arguments, so using a block is equivalent to using a function pointer, with the exception that a block can be declared inline.

The method shown above is a simplified version. The more complex variant includes an options parameter that is an NSEnumerationOptions value. This is an enumerated type that specifies whether the enumeration should proceed forward, in reverse, or in parallel. If you specify NSEnumerationConcurrent, then the array may spawn a new thread or use a thread from a pool to split the enumeration across multiple processors. This is usually only a good idea for large arrays or blocks that take a long time to execute.

Foundation defines two other kinds of blocks for use with collections: test blocks and comparator blocks. A test block returns a BOOL, while a comparator is defined by the NSComparator typedef:

typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);

Comparator blocks are used everywhere that sorting might be performed. Both mutable and immutable arrays can be sorted with comparators but so can sets and dictionaries. This includes some quite complex methods, such as this one from NSDictionary:

- (NSArray*)keysSortedByValueUsingComparator: (NSComparator)cmptr;

The argument to this method is a comparator block that defines the ordering of two objects. This will be called with all of the values in the dictionary, and the method will return an array containing all of the keys in the order that their values are listed. This can then be used to visit the values in this order by sending -valueForKey: messages to the dictionary.

Test blocks are used for filtering. Unlike comparators, they do not have a specific type associated with them because each class defines the arguments that a test block takes. For example, NSIndexSet test blocks take an NSUInteger argument, while tests for NSDictionary take both the key and value as arguments.

Most collection classes, including those outside of Foundation, such as those managed by the Core Data framework support NSPredicate as a means of filtering. As of OS X 10.6, you can also create NSPredicate instances from test blocks. You can also create NSSortDescriptor instances, which are heavily used in conjunction with Cocoa bindings from comparator blocks and, using the -comparator method turn an NSSortDescriptor object into a comparator block.

4.5.3 Supporting Fast Enumeration

From time to time, you will want to implement your own collection classes, and want to use them with the new for...in loops. If your collection can create enumerators, then you can use the enumerator as the enumerator's support for fast enumeration, but this is slightly unwieldy and slow. Full support requires collections to conform to the NSFastEnumeration protocol and implement the following method:

- (NSUInteger)countByEnumeratingWithState: (NSFastEnumerationState*)state
                                  objects: (id*)stackbuf
                                    count: (NSUInteger)len;

Understanding this method requires understanding the NSFastEnumerationState structure. This is defined in the NSEnumerator.h Foundation header, as shown in Listing 4.9.

Listing 4.9. The fast enumeration state structure. [from: NSEnumerator.h]

19| typedef struct {
20|     unsigned long state;
21|     id *itemsPtr;
22|     unsigned long *mutationsPtr;
23|     unsigned long extra[5];
24| } NSFastEnumerationState;

The first time this method is called, it should initialize the mutationsPtr field of this structure. This must be a valid pointer to something at least as big as a long. The caller will automatically cache the pointed-to value when the method is first called and then compare this on every subsequent iteration through the loop. If it has changed, then an exception will be thrown. In contrast, an NSEnumerator has no way of knowing if the collection it is enumerating has changed.

The second argument is a pointer to a buffer allocated by the caller, and the third is the size of this buffer. If the collection stores objects internally in a C array, it can return a pointer to this directly by setting state->itemsPtr to the array and returning the number of elements. Otherwise, it copies up to len elements into stackbuf and returns the number it copies. The compiler currently sets len to 16, and so only a single message send is required for every 16 items enumerated. In contrast, at least 32 will be required when using an enumerator (one to the enumerator and one from the enumerator to the collection). It is easy to see why Apple calls this the 'fast enumeration' system.

To see how you can support fast enumeration in your own collections, we will create two new classes, as shown in Listing 4.10. These both conform to the NSFastEnumeration protocol. One is mutable and the other immutable. Supporting fast enumeration is done slightly differently for mutable and immutable objects.

Listing 4.10. Integer array interfaces. [from: examples/FastEnumeration/IntegerArray.h]

 1| #import <Foundation/Foundation.h>
 2|
 3| @interface IntegerArray : NSObject<NSFastEnumeration> {
 4|     NSUInteger count;
 5|     NSInteger *values;
 6| }
 7| - (id)initWithValues: (NSInteger*)array count: (NSUInteger)size;
 8| - (NSInteger)integerAtIndex: (NSUInteger)index;
 9| @end
10|
11| @interface MutableIntegerArray : IntegerArray {
12|     unsigned long version;
13| }
14| - (void)setInteger: (NSInteger)newValue atIndex: (NSUInteger)index;
15| @end

The most noticeable difference in the interface is that the mutable version has a version instance variable. This is used to track whether the object has changed during enumeration.

The immutable version is shown in Listing 4.11. The first two methods are very simple; they just initialize the array and allow values to be accessed. The array is a simple C buffer, created with malloc(). The -dealloc method frees the buffer when the object is destroyed.

Listing 4.11. A simple immutable integer array supporting fast enumeration. [from: examples/FastEnumeration/IntegerArray.m]

 3| @implementation IntegerArray
 4| - (id)initWithValues: (NSInteger*)array count: (NSUInteger)size
 5| {
 6|     if (nil == (self = [self init])) { return nil; }
 7|     count = size;
 8|     NSInteger arraySize = size * sizeof(NSInteger);
 9|     values = malloc(arraySize);
10|     memcpy(values, array, arraySize);
11|     return self;
12| }
13| - (NSInteger)integerAtIndex: (NSUInteger)index
14| {
15|     if (index >= count)
16|     {
17|         [NSException raise: NSRangeException
18|                     format: @"Invalid_index"];
19|     }
20|     return values[index];
21| }
22| - (NSUInteger)countByEnumeratingWithState: (NSFastEnumerationState*)state
23|                                   objects: (id*)stackbuf
24|                                     count: (NSUInteger)len
25| {
26|     NSUInteger n = count - state->state;
27|     state->mutationsPtr = (unsigned long *)self;
28|     state->itemsPtr = (id*)(values + state->state);
29|     state->state += n;
30|     return n;
31| }
32| - (void)dealloc
33| {
34|     free(values);
35|     [super dealloc];
36| }
37| @end

The fast enumeration implementation here returns a pointer to the instance variable, on line 28. This code is written to support partial enumeration, where the caller only requests some subset of the total collection. This is not currently supported by the compiler, but, because this is just an Objective-C method, you cannot guarantee that it will not be called directly by some code wanting just the values after a certain element. The state field will be set to the first element that the caller wants. In normal use, this will be either 0 or count. The items pointer is set to the correct offset in the instance variable array using some simple pointer arithmetic.

The state field is updated to equal the index of the last value and the array is returned. Any for...in loop will call this method twice. After the first call the state field will have been set to count. In the second call, the value of n will be set to 0 and the loop will terminate.

Note that the mutations pointer is set to self. Dereferencing this will give the isa pointer. This class does not support modifying the values, but some other code may change the class of this object to a subclass that does. In this case, the mutation pointer will change. This is very unlikely; for most cases the self pointer is a convenient value because it is a pointer that is going to remain both valid and constant for the duration of the loop.

The mutable case is a bit more complicated. This is shown in Listing 4.12. This class adds a method, allowing values in the array to be set. Note that on line 42 the version is incremented. This is used to abort enumeration when the array is modified.

The enumeration method in this class sets the mutation pointer to the address of the version instance variable. The initial value of this is cached by the code generated from the loop construct, and every loop iteration will be compared against the current value to detect changes.

Listing 4.12. A simple mutable integer array supporting fast enumeration. [from: examples/FastEnumeration/IntegerArray.m]

39| @implementation MutableIntegerArray
40| - (void)setInteger: (NSInteger)newValue atIndex: (NSUInteger)index
41| {
42|     version++;
43|     if (index >= count)
44|     {
45|         values = realloc(values, (index+1) * sizeof(NSInteger));
46|         count = index + 1;
47|     }
48|     values[index] = newValue;
49| }
50| - (NSUInteger)countByEnumeratingWithState: (NSFastEnumerationState*)state
51|                                   objects: (id*)stackbuf
52|                                     count: (NSUInteger)len
53| {
54|     NSInteger n;
55|     state->mutationsPtr = &version;
56|     n = MIN(len, count - state->state);
57|     if (n >= 0)
58|     {
59|         memcpy(stackbuf, values + state->state, n * sizeof(NSInteger));
60|         state->state += n;
61|     }
62|     else
63|     {
64|         n = 0;
65|     }
66|     state->itemsPtr = stackbuf;
67|     return n;
68| }
69| @end

Because the mutable array's internal array can be reallocated and become invalid, we copy values out onto the stack buffer. This is not technically required; the collection is not thread-safe anyway, and so the array cannot be accessed in a way that would cause problems, but it's done here as an example of how to use the stack buffer.

The stack buffer has a fixed size. This is typically 16 entries. On line 56, we find which is smaller out of the number of slots in the stack buffer and the number of elements left to return. We then copy this many elements on line 59. The items pointer is then set to the stack buffer's address.

Using the stack buffer is entirely optional. Our immutable array didn't use it, while this one does. It is there simply as a convenient place to put elements if the class doesn't use an array internally.

To test these two classes, we use the simple program shown in Listing 4.13. This creates two integer arrays, one mutable and one immutable, and iterates over both of them using the fast enumeration for...in loop construct.

Listing 4.13. Testing the fast enumeration implementation. [from: examples/FastEnumeration/test.m]

 1| #import "IntegerArray.h"
 2|
 3| int main(void)
 4| {
 5|     [NSAutoreleasePool new];
 6|     NSInteger cArray[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
           15, 16, 17, 18, 19, 20};
 7|     IntegerArray *array = [[IntegerArray alloc] initWithValues: cArray
 8|                                                          count: 20];
 9|     NSInteger total = 0;
10|     for (id i in array)
11|     {
12|         total += (NSInteger)i;
13|     }
14|     printf("total:_%d\n", (int)total);
15|     MutableIntegerArray *mutablearray =
16|         [[MutableIntegerArray alloc] initWithValues: cArray
17|                                               count: 20];
18|     [mutablearray setInteger: 21 atIndex: 20];
19|     for (id i in mutablearray)
20|     {
21|         total += (NSInteger)i;
22|     }
23|     printf("total:_%d\n", (int)total);
24|     for (id i in mutablearray)
25|     {
26|         total += (NSInteger)i;
27|         printf("value:_%d\n", (int)(NSInteger)i);
28|         [mutablearray setInteger: 22 atIndex: 21];
29|     }
30|     return 0;
31| }

Note that the type of the element in these loops has to be an id. This is only a requirement of the type checker. The compiler does not insert any message sends to the returned objects, so as long as they are the same size as an id they can be returned.

On line 28, we modify the collection inside a loop. This is exactly the kind of thing that the fast enumeration structure's mutation pointer field is intended to detect. If we have written the implementation correctly, then an exception will be thrown. Running the program, we see that this does happen:

$ gcc -framework Foundation *.m && ./a.out
total: 210
total: 441
value: 1
2009-02-21 16:24:56.278 a.out[4506:10b] *** Terminating app
due to uncaught exception 'NSGenericException', reason:
'*** Collection <MutableIntegerArray: 0x1004bb0> was mutated
while being enumerated.'

We didn't have to do anything explicit here to raise the exception. Just modifying the version instance variable did it. Note that the exception was raised after the first loop iteration, even though the first 16 values were all returned at once. This is why the mutation pointer is a pointer and not just a value. If it had been a simple value that we had set to the value of the version ivar in each call, the loop would not have been able to detect the mutation until the next call. Because it is a pointer, it can be dereferenced and tested very cheaply at each loop iteration and so the mutation is caught the first time the caller tries to load a value from the array that has since changed.

Because we modified the version counter before making any changes to the array, we guaranteed that the mutation will always be caught. If you add any other mutation methods to the class, just remember to add version++ at the start, and this will keep working.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020