最近作ったアプリをAd-Hoc版としてwebからインストールできるようにした! Provisioning周りを久しぶりにいじってたけど、完全に忘れていた、、、
導入としては、下記リンク先の概念図が非常にわかりやすいと思う
http://qiita.com/fujisan3/items/d037e3c40a0acc46f618
iOS devの操作→Google Driveを使ってAd-Hoc公開までの手順は、
忘れないうちにまとめておこう…
2016年1月7日木曜日
2015年11月28日土曜日
2014年10月13日月曜日
UINavigationBarのtitle、backButtonのフォントを変える
まず、「AppDelegate.m」の『- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions』に、
次に、NavigationControllerの『ViewDidLoad』に、
それはそうと、m+フォントってとても美しいよね
UIFont *barButtonTitleFont = [UIFont fontWithName:@"mplus-2p-light" size:13];
UIColor *barButtonTitleColor = [UIColor whiteColor];
[[UIBarButtonItem appearance] setTitleTextAttributes:@{UITextAttributeFont:barButtonTitleFont, UITextAttributeTextColor:barButtonTitleColor} forState:UIControlStateNormal];
を記述。これで、BackButtonのフォントが変わる次に、NavigationControllerの『ViewDidLoad』に、
UILabel* label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 200, 44)];
label.backgroundColor = [UIColor clearColor];
label.font = [UIFont fontWithName:@"mplus-2p-light" size:22.0f];
label.textColor = [UIColor flatWhiteColor];
label.text = @"タイトル";
label.textAlignment = NSTextAlignmentCenter;
self.navigationItem.titleView = label;
を記述。これで、タイトルのフォントが変わる。それはそうと、m+フォントってとても美しいよね
ラベル:
iOS,
objective-C,
アプリ
2014年4月29日火曜日
【UICollectionView】カスタムセルをxibで作成
storyboard上でUICollectionViewを用意して、
xibで作ったUICollectionViewCellのカスタムクラスを配置する
1. file > new > file > UserInterface でviewを選択、ファイル名をmyCell.xib
ラベルをUICollectionViewCellの上に配置する
2. 同じ名前の.hと.mファイルを作成する
3. myCell.xibのFIle's ownerのCustom ClassをmyCellに
viewを選択して、identifierをmyCellに
Custom CalssもmyCellに
myCellにプロパティを記述
myCell.h
4. myCell.xibのFIle's ownerではなく、viewを選択して
inspectorのoutletから用意したプロパティとxib上のラベルをつなぐ
このやりかたでないと、
とエラーが...
xibで作ったUICollectionViewCellのカスタムクラスを配置する
1. file > new > file > UserInterface でviewを選択、ファイル名をmyCell.xib
ラベルをUICollectionViewCellの上に配置する
2. 同じ名前の.hと.mファイルを作成する
3. myCell.xibのFIle's ownerのCustom ClassをmyCellに
viewを選択して、identifierをmyCellに
Custom CalssもmyCellに
myCellにプロパティを記述
myCell.h
#importmyCell.m@interface myCell : UICollectionViewCell @property (strong, nonatomic) IBOutlet UILabel *cellLabel; @end
#import "myCell.h"
@implementation myCell
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
-(void)awakeFromNib
{
NSLog(@"bundleLoader waked");
}
@end
inspectorのoutletから用意したプロパティとxib上のラベルをつなぐ
このやりかたでないと、
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSObject 0x6858780> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key…
とエラーが...
5. あとはcollectionViewController.mで
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView
cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
NSString *identifier = @"myCell";
static BOOL nibCellLoaded = NO;
if(!nibCellLoaded){
UINib *nib = [UINib nibWithNibName:@"myCell" bundle:nil];
[collectionView registerNib:nib forCellWithReuseIdentifier:identifier];
nibCellLoaded = YES;
}
myCell *cell = (OBWeather*)[collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
cell.backgroundColor = [UIColor greenColor];
return cell;
}
最後に思ったけど、
クラス名とidentifierって一緒じゃない方がいいのかなあ
ラベル:
iOS,
objective-C,
アプリ
【iOS】Podfileの設定とエラー
Podfileの記述例:
[参考]http://qiita.com/u651601f/items/87203d22857d3634f955
platform :ios, '7.0' pod 'LXReorderableCollectionViewFlowLayout' pod 'MagicalRecord'
[!] Unable to satisfy the following requirements:
- `LXReorderableCollectionViewFlowLayout (= 4.3)` required by `Podfile`
みたいなエラーが出る場合は、上記の例みたいにiOSのバージョンを指定する必要がある[!] Oh no, an error occurred. Search for existing github issues similar to yours:ってエラーが出る場合はこれ
$ sudo rm -rf ~/.cocoapods/repos/master $ sudo pod setup
[参考]http://qiita.com/u651601f/items/87203d22857d3634f955
【UICollectionView】セルの並び替えをする
iOSのホーム画面みたいに、UICollectionViewのセルを並び替えるライブラリ
http://urouro.net/blog/2014/01/17/lxreorderablecollectionviewflowlayout/
いつか使えるであろう...
http://urouro.net/blog/2014/01/17/lxreorderablecollectionviewflowlayout/
いつか使えるであろう...
2014年4月25日金曜日
【iOS】メソッドのラベルを省略
Obj-Cで、引数が複数あるメソッドは通常
と続くが、ラベルは省略可能(推奨はされてない?)ということを知りました。
省略すると
となります。呼び出す時は、
すごい違和感
- (リターン型)メソッド名:(引数型1)引数名1 ラベル:(引数型2)引数名2 ラベル:(引数型3)引数名3...
と続くが、ラベルは省略可能(推奨はされてない?)ということを知りました。
省略すると
- (リターン型)メソッド名:(引数型1)引数名1:(引数型2)引数名2:(引数型3)引数名3...
となります。呼び出す時は、
[インスタンス名 メソッド名:引数1:引数2:引数3];
すごい違和感
ラベル:
iOS,
objective-C,
アプリ
2014年4月23日水曜日
【iOS】マルチスレッド
マルチスレッドに手をつけたのでメモ
http://blog.77jp.net/dispatch_async-copy-paste
コードが美しい
http://blog.77jp.net/dispatch_async-copy-paste
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// バックグランドでAPIなどを実行
});
dispatch_async(dispatch_get_main_queue(), ^{
// メインスレッドで処理をしたい内容、UIを変更など。
});
// APIなどはバックグランドで実行して、UIはメインスレッドで処理をしたい場合。
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// バックグランドでAPIなどを実行
dispatch_async(dispatch_get_main_queue(), ^{
// メインスレッドで処理をしたい内容、UIを変更など。
});
});
ちなみに今回からSyntax Highlighterを導入してみましたコードが美しい
2014年3月26日水曜日
【UITableViewCell】UITableViewCell上のUIButtonのイベントを受け取る
UITableViewCellにUIButtonを配置したけど、タップしても反応しないっていう時があります
しかし、なぜか反応するときもあります 謎です
色々調べると、解決方法はいくつかあるみたいだけど、一番簡単な方法はこれ
http://paranishian.hateblo.jp/entry/objc/ios7-tableviewcell
実にスマート!
しかし、なぜか反応するときもあります 謎です
色々調べると、解決方法はいくつかあるみたいだけど、一番簡単な方法はこれ
http://paranishian.hateblo.jp/entry/objc/ios7-tableviewcell
-(void)awakeFromNib { [self.contentView setUserInteractionEnabled: NO]; }
実にスマート!
【iOS】Auto Layoutのお話
iPhone4以前とそれ以降では画面のサイズが違うから、
xibの2種類いるんじゃね?って思ってたけどそんなことなかった
xibのinspectorでauto sizingを設定すれば、レスポンシブな感じにできるんだけど、
auto sizingの設定項目がない!ってときにはこれを確認
http://dev.classmethod.jp/references/ios-7-xcode-5-auto-layout-2/
xibの2種類いるんじゃね?って思ってたけどそんなことなかった
xibのinspectorでauto sizingを設定すれば、レスポンシブな感じにできるんだけど、
auto sizingの設定項目がない!ってときにはこれを確認
http://dev.classmethod.jp/references/ios-7-xcode-5-auto-layout-2/
Use AutoLayoutのチェックを外すと出てきます
2014年2月20日木曜日
【cookie】webサイトからcookieを受け取る方法
cookieってなんとなく分かってたつもりだけど
詳しく知らなかった…
webサイトにPOSTして返ってきたcookieを保存したりする方法
http://www.yoheim.net/blog.php?q=20130701
cookieを返すかどうかの設定はサイト側で行えば良いんだと思う
あと、cookie使うメリットは、最初に認証してそのときに貰ったcookieを使えば、
2回目以降の認証をする必要がないってこと
「あー、cookieね、はいはい、で、なんだっけ?」
みたいな感じから少しレベルアップした気がした
詳しく知らなかった…
webサイトにPOSTして返ってきたcookieを保存したりする方法
http://www.yoheim.net/blog.php?q=20130701
cookieを返すかどうかの設定はサイト側で行えば良いんだと思う
あと、cookie使うメリットは、最初に認証してそのときに貰ったcookieを使えば、
2回目以降の認証をする必要がないってこと
「あー、cookieね、はいはい、で、なんだっけ?」
みたいな感じから少しレベルアップした気がした
2014年2月4日火曜日
リジェクト…
一回目の審査でリジェクトされました
These examples identify types of issues discovered in your app but may not represent all such issues. It would be appropriate to thoroughly evaluate your app to address these types of issues.
[追記]
http://sarudeki.jp/arudente/2012/09/26/apple-リジェクト-(reject)まとめ一覧/
[追記]
なんか、18.2に関しては以下のサイトに載ってるやつと一緒ぽい
解決できるかなあ
https://support.tapatalk.com/threads/need-some-help-with-getting-my-app-approved.17350/
http://stackoverflow.com/questions/16456351/app-store-rejection-18-2
[追記]
こっち見たらいけそうな気がしてきた
http://neoinspire.net/archives/336#.UvCJi3l6ois
- 10.6: Apple and our customers place a high value on simple, refined, creative, well thought through interfaces. They take more work but are worth it. Apple sets a high bar. If your user interface is complex or less than very good it may be rejected
- 18.2: Apps that contain user generated content that is frequently pornographic (ex "Chat Roulette" apps) will be rejected
- 22.2: Apps that contain false, fraudulent or misleading representations will be rejected
10.6
We found the following issues with the user interface of your app:
- Did not include iOS features. For example, it would be appropriate to use native iOS buttons and iOS features other than just web views, Push Notifications, or sharing.
We found the following issues with the user interface of your app:
- Did not include iOS features. For example, it would be appropriate to use native iOS buttons and iOS features other than just web views, Push Notifications, or sharing.
以下、Google翻訳
IOS機能が含まれていませんでした。たとえば、ネイティブのiOSのボタンを使用することが適切であろうとiOSは単なるウェブ景色以外の他の機能、プッシュ通知、または共有。
IOS機能が含まれていませんでした。たとえば、ネイティブのiOSのボタンを使用することが適切であろうとiOSは単なるウェブ景色以外の他の機能、プッシュ通知、または共有。
These examples identify types of issues discovered in your app but may not represent all such issues. It would be appropriate to thoroughly evaluate your app to address these types of issues.
[追記]
http://sarudeki.jp/arudente/2012/09/26/apple-リジェクト-(reject)まとめ一覧/
[追記]
なんか、18.2に関しては以下のサイトに載ってるやつと一緒ぽい
解決できるかなあ
https://support.tapatalk.com/threads/need-some-help-with-getting-my-app-approved.17350/
http://stackoverflow.com/questions/16456351/app-store-rejection-18-2
[追記]
こっち見たらいけそうな気がしてきた
http://neoinspire.net/archives/336#.UvCJi3l6ois
2014年1月31日金曜日
2014年1月27日月曜日
【iOSアプリ】アプリの審査待ちでそわそわしたら
以下のサイトで審査の込み具合が確認できるみたい
・Apple公式ページ
https://developer.apple.com/news/
・世界中のアプリ開発者から自己申告されたレビュー日数を元に平均日数を算出してくれるサービス…らしい (Qiitaより)
http://reviewtimes.shinydevelopment.com
5営業日以内に審査始まるってこと?
・Apple公式ページ
https://developer.apple.com/news/
・世界中のアプリ開発者から自己申告されたレビュー日数を元に平均日数を算出してくれるサービス…らしい (Qiitaより)
http://reviewtimes.shinydevelopment.com
5営業日以内に審査始まるってこと?
2014年1月26日日曜日
【スクレイピング】webサイトからデータをパクってくる
・スクレイピングするライブラリ
結局は<td class = ~~>とか<div img=~~>の~~の部分しか取って来れなくて、
タグとタグの間の文字をとれなかった
http://d.hatena.ne.jp/laiso+iphone/20120715/1342350160
・webサイトのhtmlをダウンロードして、innerhtmlを解析する
https://github.com/acoomans/WebScraper
タグとタグのデータをとる方法
HTMLParserを使って 解析する
結局は<td class = ~~>とか<div img=~~>の~~の部分しか取って来れなくて、
タグとタグの間の文字をとれなかった
http://d.hatena.ne.jp/laiso+iphone/20120715/1342350160
・webサイトのhtmlをダウンロードして、innerhtmlを解析する
https://github.com/acoomans/WebScraper
タグとタグのデータをとる方法
HTMLParser *parser = [[HTMLParser alloc] initWithString:htmlstring error:&error];if (error) {//NSLog(@"Error: %@", error);return;}
HTMLNode *bodyNode = [parser body];NSArray *inputNodes = [bodyNode findChildTags:@"div"];//divタグの物を全部とってくるitem = [[NSMutableDictionary alloc]init];int appendCount = 0;for (HTMLNode *inputNode in inputNodes) {if([[inputNode getAttributeNamed:@"class"] isEqualToString:@"name"]){//そのなかでclass属性がnameの物にしぼる。homeTeam = [[NSString alloc]init];homeTeam = [inputNode contents];homeTeam = [homeTeam stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];[item setObject:homeTeam forKey:@"home"];appendCount++;}
HTMLParserを使って 解析する
【UIWebView】クラッシュあるある
要は、Viewが消えるときに、activityIndicatorを消してないとクラッシュするらしい
http://iapp7.blog29.fc2.com/blog-entry-100.html
こっちはdeallocのこと書いてるけど、ARCではdeallocとか意識しなくてよかった気がする
1. http://www.zero4racer.com/blog/628
2. http://www.zero4racer.com/blog/642
http://iapp7.blog29.fc2.com/blog-entry-100.html
こっちはdeallocのこと書いてるけど、ARCではdeallocとか意識しなくてよかった気がする
1. http://www.zero4racer.com/blog/628
2. http://www.zero4racer.com/blog/642
【アイコン作成】iOSアプリのアイコンについて
アイコンのサイズの早見表
1024×1024はGimpで作って、角を丸くするのは難しそうだったから
Icon Shaperっていうアプリを買った
http://dev.classmethod.jp/references/ios-device-icon-file-list-2013-9/
トースターみたいに簡単にいろんなサイズのアイコンを出してくれる
けど、申請時は1024×1024しか使ってないから、ぶっちゃけ必要かどうか分からん
http://makeappicon.com
トースターみたいに簡単にいろんなサイズのアイコンを出してくれる
けど、申請時は1024×1024しか使ってないから、ぶっちゃけ必要かどうか分からん
http://makeappicon.com
1024×1024はGimpで作って、角を丸くするのは難しそうだったから
Icon Shaperっていうアプリを買った
登録:
投稿 (Atom)









