int i;
>
> //initialize the threadLock with the number of thread
>
> [threadLock lock];
> [threadLock unlockWithCondition:count];
>
> NSPort *mainPort = [NSMachPort port];
> if (!mainPort)
> {
> return;
> }
>
> [mainPort setDelegate:self];
>
> [[NSRunLoop currentRunLoop] addPort:mainPort
> forMode:NSDefaultRunLoopMode];
>
> NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
> [parameters setObject:mainPort forKey:@"port"];
>
> // start the secondary threads
> // loop starts at 1 because the main thread is also used (see below)
>
> for (i=0;i<count;i++) {
> [NSThread detachNewThreadSelector:@selector(runJobs:)
> toTarget:self
> withObject:parameters];
> }
>
> //wait until done, ie until the count of threads in threadLock is
> down to 0
>
> [threadLock lockWhenCondition:0];
> [threadLock unlock];
> }
If the application you create is useful, you will want to share it with all the people of the world. Unfortunately, we don't all speak the same language. Suppose that you wish to make your RaiseMan application available to French speakers. We would say, "You are going to localize RaiseMan for French speakers."
If you are creating an application for the world, you should plan on localizing it for at least the following languages: English, French, Spanish, German, Dutch, Italian, and Japanese. Clearly, you do not want to have to rewrite the entire app for each language. In fact, our goal is to ensure that you don't have to rewrite any Objective-C code for each language. That way, all the nations of the world can use a single executable in peace and harmony.
Instead of creating multiple executables, you will localize resources and create string tables. Inside your project directory, an English.lproj directory holds all the resources for English speakers: nib files, images, and sounds. To localize the app for French speakers, you will add a French.lproj directory. The nibs, images, and sounds in this directory will be appropriate for French speakers. At runtime, the app will automatically use the version of the resource appropriate to the user's language preference.
Framework bundles use a bundle structure different from the bundle structure used by applications. The
structure for frameworks is based on an earlier bundle format, and allows for multiple versions of the framework
code and header files to be stored inside the bundle. This type of bundle is known as a versioned bundle.
Supporting multiple versions of a framework allows older applications to continue running even as the
framework binary continues to evolve.