
PS: По совету твиттер пользователя @iLeNsTR можно обойтись флагами компилятора:

$ xcodebuild [-project <projectname>] [-activetarget] [-alltargets] [-target<targetname>]... [-parallelizeTargets] [-activeconfiguration] [-configuration<configurationname>] [-sdk <sdkfullpath>|<sdkname>] [-xcconfig <filepath>][<buildsetting>=<value>]... [<buildaction>]...из испольуемых мной параметров:
$ man xcodebuildВ качестве "бонуса" приведу пример баш скрипта, который собирает приложение с конфигурацией "Distribution" и создает *.ipa файл. Подразумевается, что конфигурация "Distribution" настроена на подписку приложения сертификатом Ad-Hoc. Скрипт не проверяет ошибки вывода комманд, да и написался он быстрее чем этот пост:
#!/bin/sh cd ~/work/my_project/trunk/my_project rm -fr ./build xcodebuild -target my_project -configuration Distribution -sdk iphoneos4.3 rm -fr ../tmp mkdir ../tmp mkdir ../tmp/Payload cp -r ./build/Distribution-iphoneos/my_project.app ../tmp/Payload/ cp ./Resources/icon\@2x.png ../tmp/iTunesArtwork cd ../tmp/ zip -r7 my_project.zip ./iTunesArtwork ./Payload mv ./my_project.zip ../my_project.ipa cd .. rm -fr ./tmp cp ./my_project.ipa ~/Desktop
Command /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin /Contents/Resources/copystrings failed with exitcode 1Решилась довольно просто, в фале "Localizable.strings" забыл в конце строки проставить ";"
- UIAlertView *tmp = [[UIAlertView alloc] initWithTitle:@"Warning" message:@"Your e-mail application not configured" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
- [tmp show];
- [tmp release];
- UIAlertView *tmp = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Warning", @"") message:NSLocalizedString(@"Your e-mail application not configured", @"") delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"") otherButtonTitles:nil];
- [tmp show];
- [tmp release];
- $ genstrings ./*.m





- "Done" = "Готово";














- AudioStreamBasicDescription mDataFormat;
- mDataFormat.mFormatID = kAudioFormatLinearPCM;
- mDataFormat.mSampleRate = 44100;
- mDataFormat.mChannelsPerFrame = 1;
- mDataFormat.mBitsPerChannel = 16;
- mDataFormat.mBytesPerPacket =
- mDataFormat.mBytesPerFrame = mDataFormat.mChannelsPerFrame * sizeof(short int);
- mDataFormat.mFramesPerPacket = 1;
- mDataFormat.mFormatFlags = kLinearPCMFormatFlagIsBigEndian
- | kLinearPCMFormatFlagIsSignedInteger
- | kLinearPCMFormatFlagIsPacked;
- AudioQueueRef queue;
- AudioQueueNewInput(&mDataFormat, AQInputCallback,
- NULL, NULL, kCFRunLoopCommonModes, 0, &queue);
- unsigned long frameSize = mDataFormat.mSampleRate * mDataFormat.mBytesPerFrame;
- AudioQueueBufferRef aBuffers[AUDIO_BUFFERS];
- for (int i=0; i<AUDIO_BUFFERS; i++)
- {
- AudioQueueAllocateBuffer(queue, frameSize, &aBuffers[i]);
- AudioQueueEnqueueBuffer(queue, aBuffers[i], 0, NULL);
- }
- AudioQueueStart(queue, NULL);
- AudioQueueStop(queue, true);
- AudioQueueDispose(queue, true);


- NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
- NSUserDomainMask, YES);
- NSError *error;
- NSFileManager *fileManager = [NSFileManager defaultManager];
- NSLog(@"%@", [fileManager contentsOfDirectoryAtPath:[paths objectAtIndex:0] error:&error]);
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShown:) name:UIKeyboardWillShowNotification object:nil];
- [[NSNotificationCenter defaultCenter] removeObserver:self];
- - (void) keyboardWillShown:(NSNotification*) aNotification
- {
- NSDictionary* info = [aNotification userInfo];
- #ifdef __IPHONE_4_0
- NSValue* aValue = [info objectForKey:UIKeyboardBoundsUserInfoKey];
- if (!aValue)
- {
- aValue = [info objectForKey:UIKeyboardFrameEndUserInfoKey];
- }
- #else
- NSValue* aValue = [info objectForKey:UIKeyboardBoundsUserInfoKey];
- #endif
- CGSize keyboardSize = [aValue CGRectValue].size;
- NSLog(@"%.1fx%.1f", keyboardSize.width, keyboardSize.height);
- }

- if ([obj respondsToSelector:@selector(someSelector:)])
- {
- [obj performSelector:self withObject:nil];
- }
- UILocalNotification* alarm = [[[UILocalNotification alloc] init] autorelease];
- if (alarm)
- {
- alarm.fireDate = [[NSDate date] dateByAddingTimeInterval:30.0];
- alarm.timeZone = [NSTimeZone defaultTimeZone];
- alarm.repeatInterval = 0;
- alarm.alertBody = @"local notification";
- UIApplication *app = [UIApplication sharedApplication];
- [app scheduleLocalNotification:alarm];
- }
- @interface marker : NSObject <MKAnnotation>
- {
- }
- @end
- #import "marker.h"
- @implementation marker
- #pragma mark MKAnnotation
- - (CLLocationCoordinate2D) coordinate
- {
- return CLLocationCoordinate2DMake(46.462585, 30.750186);
- }
- - (NSString *) title
- {
- return @"This annotation";
- }
- marker *m = [[marker alloc] init];
- [mapView addAnnotation:m];
- [m release];
- CLLocationCoordinate2D mapCoords[6];
- mapCoords[ 0] = CLLocationCoordinate2DMake(46.476472, 30.704776);
- mapCoords[ 1] = CLLocationCoordinate2DMake(46.469664, 30.732229);
- mapCoords[ 2] = CLLocationCoordinate2DMake(46.462585, 30.750186);
- mapCoords[ 3] = CLLocationCoordinate2DMake(46.447197, 30.743040);
- mapCoords[ 4] = CLLocationCoordinate2DMake(46.415384, 30.723226);
- mapCoords[ 5] = CLLocationCoordinate2DMake(46.409143, 30.729909);
- MKPolyline *polyLine = [MKPolyline polylineWithCoordinates:mapCoords count:6];
- [mapView addOverlay:polyLine];
- [mapView setDelegate:self];
- - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)overlay
- {
- MKPolylineView *polylineView = [[[MKPolylineView alloc] initWithOverlay:overlay] autorelease];
- polylineView.strokeColor = [UIColor blueColor];
- polylineView.lineWidth = 3.0;
- return polylineView;
- }
- MPMusicPlayerController *ipod = [MPMusicPlayerController iPodMusicPlayer];
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(playbackItemChanged:)
- name:MPMusicPlayerControllerNowPlayingItemDidChangeNotification
- object:ipod];
- [ipod beginGeneratingPlaybackNotifications];
- [ipod setQueueWithQuery:[MPMediaQuery songsQuery]];
- [ipod play];
- NSURL *file = [[NSURL alloc] initFileURLWithPath:
- [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"a_hot.caf"]];
- NSError *err = nil;
- player = [[AVAudioPlayer alloc] initWithContentsOfURL:file error:&err];
- [file release];
- player.numberOfLoops = -1;
- player.delegate = self;
- [player prepareToPlay];
- if (player.playing)
- {
- [player stop];
- [playStopBtn setTitle:NSLocalizedString(@"Play", @"") forState:UIControlStateNormal];
- [tmUpdaterTimer invalidate];
- [tmUpdaterTimer release];
- tmUpdaterTimer = nil;
- }
- else
- {
- [player play];
- [playStopBtn setTitle:NSLocalizedString(@"Stop", @"") forState:UIControlStateNormal];
- tmUpdaterTimer = [[NSTimer scheduledTimerWithTimeInterval:0.2
- target:self selector:@selector(timerAction:)
- userInfo:nil repeats:YES] retain];
- }
- - (void) timerAction:(NSTimer *) sender
- {
- [tmSlider setValue:player.currentTime animated:YES];
- }
- - (void) changeTime:(UISlider *) sender
- {
- if (!moving)
- {
- isPlaying = player.playing;
- if (player.playing)
- {
- [player stop];
- }
- moving = YES;
- }
- player.currentTime = sender.value;
- }
- - (void) endChangeTime:(UISlider *) sender
- {
- moving = NO;
- if (isPlaying)
- {
- [player play];
- }
- }
- AudioSessionInitialize(NULL, kCFRunLoopDefaultMode, NULL, self);
- UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
- AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(sessionCategory), &sessionCategory);
- AudioSessionSetActive(true);


- // Перед тем как вызывать диалог отсылки почты необходимо проверить настроен ли у пользователя вообще почтовый клиент.
- if (![MFMailComposeViewController canSendMail])
- {
- // Клиент не настроен, показываем всплывающее окно.
- UIAlertView *tmp = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Warning", @"") message:NSLocalizedString(@"Your e-mail application not configured", @"") delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"") otherButtonTitles:nil];
- [tmp show];
- [tmp release];
- return ;
- }
- // создаем экземпляр обекта MFMailComposeViewController
- MFMailComposeViewController *mcvc = [[MFMailComposeViewController alloc] init];
- // указываем обект делегата (слушателя)
- mcvc.mailComposeDelegate = self;
- // заполняем поле "Кому"
- [mcvc setToRecipients:[NSArray arrayWithObject:@"test@example.com"]];
- // заполняем поле "Тема"
- [mcvc setSubject:NSLocalizedString(@"Testing mail", @"")];
- // пишем тело письма
- [mcvc setMessageBody:NSLocalizedString(@"This is body of mail", @"") isHTML:NO];
- // прикрепляем к письму данные как текст и указываем имя файла приложения к письму
- [mcvc addAttachmentData:[@"Text on attach" dataUsingEncoding: NSUTF8StringEncoding] mimeType:@"text/plain" fileName:@"test.txt"];
- // показываем заполненный контрол
- [self presentModalViewController:mcvc animated:YES];
- - (void) mailComposeController:(MFMailComposeViewController*) controller didFinishWithResult:(MFMailComposeResult) result error:(NSError*) error
- {
- [controller dismissModalViewControllerAnimated:YES];
- }