jueves, 29 de agosto de 2013

Mostrar una vista modal de izquierda a derecha

Para abrir la ventana
CATransition *transition = [CATransition animation];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromRight;
[self.view.window.layer addAnimation:transition forKey:nil];
[self presentModalViewController:viewCtrl animated:NO];



Para cerrar la ventana cambiamos la llamada:

[self presentModalViewController:viewCtrl animated:YES];


Por


CATransition *transition = [CATransition animation];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromRight;
[self.view.window.layer addAnimation:transition forKey:nil];

[self presentModalViewController:viewCtrl animated:NO];

miércoles, 28 de agosto de 2013

Poner una imagen en un control UIPickerView

Hay que utilizar este metodo en lugar del que solo devuelve el texto.

- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
{
     NSString *t=@"";
     UIView *tmpView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 280, 32)];
    UILabel *channelLabel = [[UILabel alloc] initWithFrame:CGRectMake(30, 0, 250, 25)];
             t=def.funciones[row];
               UIImage *img = [UIImage imageNamed:@"Nombredelaimagen"];
             UIImageView *temp = [[UIImageView alloc] initWithImage:img];
             temp.frame = CGRectMake(0, 0, 25, 25);
                [tmpView insertSubview:temp atIndex:0];
     channelLabel.text = @"El texto que quieres";
    [channelLabel adjustsFontSizeToFitWidth];
    channelLabel.textAlignment = UITextAlignmentLeft;
    channelLabel.backgroundColor = [UIColor clearColor];
    [tmpView insertSubview:channelLabel atIndex:0];
   
    return tmpView;


}

Como detectar el dispositivo y el idioma

Para detectar el idioma:
NSString *locale = [[NSLocale currentLocale] localeIdentifier]; // en_US

Para detectar el dispositivo:
 if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        if (altopantalla == 568)
        {
            //es un iphone 5
            
        }
        else
        {
            //es un iphone
            
        }
    } else {
       //es un ipad
    }

miércoles, 1 de mayo de 2013

Generar certificado APNS

To generate a certificate on a Mac OS X:
  1. Log-in to the iPhone Developer Program Portal
  2. Choose App IDs from the menu on the right (or click here)
  3. Create an App ID without a wildcard. For example 3L223ZX9Y3.com.armiento.test
  4. Click the Configure link next to this App ID and then click on the button to start the wizard to generate a new Development Push SSL Certificate (Apple Documentation: Creating the SSL Certificate and Keys)
  5. Download this certificate and double click on aps_developer_identity.cer to import it into your Keychain
  6. Launch Keychain Assistant (located in Application, Utilities or search for it with Spotlight) and click on My Certificates on the left
  7. Expand Apple Development Push Services and select Apple Development Push Services AND your private key (just under Apple Development Push Services)
  8. Right-click and choose "Export 2 elements..." and save as server_certificates_bundle_sandbox.p12 (don't type a password).
  9. Open Terminal and change directory to location used to save server_certificates_bundle_sandbox.p12 and convert the PKCS12 certificate bundle into PEM format using this command (press enter when asked for Import Password):
  10. openssl pkcs12 -in server_certificates_bundle_sandbox.p12 -out server_certificates_bundle_sandbox.pem -nodes -clcerts

lunes, 28 de enero de 2013

Poner un disco SSD como primario en macbook pro

No tiene que ver con Xcode, pero hace  que vaya mas rapido :)

Despues de desmontar el portatil quité el CD y le puse el disco SSD como disco secundario.



Luego se arranca y se clona el disco con el siguiente programa:
http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html
Estos son los pasos:
http://circuitremix.com/?q=content/macbook-pro-solid-state-drive-upgrade-guide-and-performance-testing

Por ultimo vuelvo a desmontar el portatil e intercambio los discos.
Arranco y desde preferencias me voy a reiniciar y selecciono como disco de arranque el SSD y a volar .....