NakajiJapan

餓鬼の超弩級日記


Code Sign error: Provisioning profile “hogehoge” can’t be found がでたとき

iPhone変更したからそれにともない鍵の更新が必要になった。
何も気にせずしようとしたらタイトルのようなエラーが発生したのでメモ。

hogehoge.xcodeproj/project.pbxprojファイルをテキストエディタで開きます。
「PROVISIONING PROFILE」なる部分をすでにiPhoneで設定されている鍵と合わせて変更すると解決する模様。

全部置換すて、無事解決しました。

■参考URL
http://ameblo.jp/iphone0126/en……55082.html

No Comments »

storyboadのページ遷移で「custom」を利用してみる

普段は「push」か「modal」で実装するけど、場合によっては違う見せ方をしたほうがいい場合があると思います。

そこで「custom」を利用してページ遷移をもっとインタラクティブに見せる実装を行います。

まずは「UIStoryboardSegue」なるクラスを継承した「DetailSegue」を作成してみます。

#import "DetailSegue.h"

@implementation DetailSegue

- (void)perform {

    // if either source or destination is nil, stop
    if (nil == self.sourceViewController || nil == self.destinationViewController) return;

    UINavigationController *ctrlSrc = [self.sourceViewController navigationController];

    [UIView beginAnimations:@"fadeOst" context:nil];
    [UIView setAnimationDuration: 0.1];

    [UIView setAnimationDelegate:self];
    [UIView setAnimationDidStopSelector:@selector(animationDidStop)];
    [[ctrlSrc view] setAlpha: 0.3];

    [UIView commitAnimations];
}
// animation end event
- (void)animationDidStop {
    UINavigationController *ctrlSrc = [self.sourceViewController navigationController];

    [UIView beginAnimations:@"fadeIn" context:nil];
    [UIView setAnimationDuration: 0.5];

    [ctrlSrc pushViewController:self.destinationViewController animated:NO];
    [[ctrlSrc view] setAlpha: 1];
    [UIView commitAnimations];
}

@end

次にStroryboadで設定を行います。以下のSeguesのCustomにしている部分(矢印)を右クリックして先ほど作成したクラスを指定するとできあがりです。

今回のアニメーションはfadeInOutを自力で作成しています。

もっと簡単にアニメーションをするんであれば、「UIView transitionWityView 」の「options」であらかじめ用意されたアニメーションを指定できるので設定するよいかもしれません。

    [UIView transitionWithView:src.navigationController.view duration:0.8
                       options:UIViewAnimationOptionTransitionCurlUp
                    animations:^{
                        [src.navigationController pushViewController:dst animated:NO];
                    }
                    completion:NULL];

■参考
https://developer.apple.com/li……6-CH3-SW83
http://developer.apple.com/lib……IView.html

No Comments »