循環参照について
Objective-cを書いてるとコンパイル時に問題となるので、まとめ。
循環参照はAファイルのヘッダーにBファイルをインポート、BファイルのヘッダーにAファイルをインポートする事で発生する。
解決策としては、実装ファイルにインポートを記載し、ヘッダーファイルでインポートが必要な場合は、@Classで定義する。
以下、実装する時の注意
・自分が作ったクラス、プロトコル等を他のクラスで使用する場合は、実装ファイルで import する。
・ヘッダファイルで出てくる場合 @class, @protocol で宣言する。
・フレームワーク等の、循環参照しないものは ヘッダファイルで import する。
↓以下記事のまとめを抜粋
【参考】
#import の使いどころ:循環参照しないために。 - webとかmacとかやってみようか - http://d.hatena.ne.jp/dice-t/20101215/1292392076
以上、おみくじを引いたら、悪ければ、杉(過ぎる)にくくりるけ、良ければ、松(待つ)にくくりつけることを最近知った堀でした。
Parse.comを知る
backendの処理を自前で作成しているが、管理含めて面倒だなーと思って調べていたら、
Parse.comっていうサービスがあったので、調査
調査した内容をリンクまとめ。
【参考】
Mobile and Design BLOG: BaaSサービスのParseを使ってみた - http://gndo.blogspot.jp/2012/03/baasparse.html
※使用する手順
[MBaaS] Parseで簡単モバイルバックエンド構築 – 【ざっと概要】 | Developers.IO - http://dev.classmethod.jp/cloud/parse-introduction-1/
[iOS] Parse.com を使った Push 通知機能の実装方法 | CodeNote.net - http://codenote.net/ios/1927.html
※SDK使用時のまとめ
[Parse][iOS] PFObjectの保存・更新・削除の基本 | Developers.IO - http://dev.classmethod.jp/smartphone/iphone/parse-ios-pfobject/
データの保存、更新、削除
RubyMotion - Parse を利用して 座標を保存するアプリサンプル - Qiita - http://qiita.com/makotoworld/items/888421bc9a0ce2c51363
[Parse] 認証を試してみる | リスティング広告の運用代行ならカルテットコミュニケーションズ - http://quartet-communications.com/info/technology/14855
storyboardやxibでインスタンスを作る
storyboardやxibでインスタンスを作る時にどうだっか、調べる事があったので、メモ
storyboard
UIViewController *controller = [[self storyboard] instantiateViewControllerWithIdentifier:@"hoge"];
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
MyViewController *controller = [segue destinationViewController];
controller.nanika = @"hogehoge";
}
xib
[[UIViewController alloc]initWithNibName:@"hoge" bundle:nil];
以上、春野菜を最近食べる事が増えた堀でした。
WordpressをグループウェアLikeに使う方法
WordpressをグループウェアLikeに構築する方法を考えるため、調査中
【参考】
YOKIZO.com - WordPressは、単にブログとしての機能を超えて、グループウェア的に構築することも可能だった件。 - http://www.yokizo.com/2010/02/25/wordpress-3
[WP] ファイル共有とかできるのか(メモ) | ファンファンファン クリエイターズ - http://fanfanfan.net/?p=1957
画期的!WordPressのプラグイン「Front-end Editor」 - http://www.broval.jp/oss/blog/?p=300
【一応参考】
PHPで出来たOSSグループウェア
グループウェア - フリー・オープンソースのグループウェアL01 - http://l-groupware.com/
オンプレミスなグループウェアについて
オンプレミスなグループウェアって今何があるか調査(2014/03/19 現在)
オンプレミスで使えるグループウェア
アイポ (株式会社エイムラック)
主な機能
○メール(アドレス付与なし。システム内メール可)
○掲示板 →階層構造には出来ないみたい
○ファイル共有
→フォルダの階層構造は可能
あくまでファイルを共有するためのフォルダ作成で、説明を記載して、
ファイルのアップロードは出来ない。
○スケジュール管理 → 直感的でスケジュール入力が容易
○ワークフロー
○設備管理
○タイムライン →タイムラインに実行した内容が表示される
○TODOリスト →TODOリストがあるため、他人の忙しさがわかりやすい
○報告書 →他の人にメッセージ付きでファイルを送れる
その他
・更新情報
・プロジェクト管理
・社内ブログ
・タスク管理
・タイムカード
・シフト管理
・伝言メモ
・バット見て、どこに何があるかわかりやすい
【料金体系】
容量での課金
【参考】
無料グループウェア「アイポ」 - http://www.aipo.com/
GRIDY (ブランドダイアログ株式会社)
主な機能
○メール(アドレス付与なし。所持アカウント使用可)
○掲示板
○ファイル共有
○スケジュール管理
○ワークフロー
○設備管理
その他
・タスク管理
・プロジェクト管理
・タイムカード
・アドレス帳
・電話メモ
・チャット
・メモ
・ワークフロー
・備品管理(在庫・履歴管理)
・資源管理(PC稼働率監視)
・スケジュールなどにアラーム有
【料金体系】
0円※ただしPCの遊休能力をシェアーする事が0円の条件
【参考】
無料のクラウド型グループウェア「GRIDY グループウェア」 - http://knowledgesuite.jp/free/index.html
GroupSession (日本トータルシステム株式会社)
主な機能
○メール(アドレス付与なし。システム内メール可。外部転送可。所持アカウント使用可)
○掲示板
○ファイル共有
○スケジュール管理
○ワークフロー
○設備管理
その他
・ワークフロー
・回覧板
・WEB検索
・在席管理
・プロジェクト管理
・RSSリーダー
・ブックマーク
・アドレス帳
【料金体系】
保守(カスタマーサポート対応)
→クラウドは月額
オンプレミスで使用する場合は、導入可能であれば、無料
【参考】
無料グループウェア GroupSession - http://www.gs.sjts.co.jp/
王道
サイボウズ ガルーン 3.7
・スケジュールの共有・管理
・共用設備の予約管理
・メールの管理・送受信
・ファイル・ドキュメントの共有
・電子会議室・BBSの利用
・社内ソーシャル
・利用者名簿・社員名簿の共有
・連絡先・アドレス帳の共有
・インフォメーション・掲示板機能
・ポータル機能
・部門別のポータル作成
・画像対応コンテンツエディタ
【料金体系】
¥600,000/50ユーザー(ユーザー数が増えると少しやすくなる)
【参考】
エンタープライズ グループウェア サイボウズ ガルーン 3 - http://products.cybozu.co.jp/garoon/
サイボウズ Office 10
・スケジュールの共有・管理
・共用設備の予約管理
・メールの管理・送受信
・ファイル・ドキュメントの共有
・電子会議室・BBSの利用
・社内ソーシャル
・利用者名簿・社員名簿の共有
・連絡先・アドレス帳の共有
・インフォメーション・掲示板機能
・ポータル機能
・画像対応コンテンツエディタ
【料金体系】
¥63,800/10ユーザー(スタンダードコース)
【参考】
グループウェア サイボウズ Office 10 - http://products.cybozu.co.jp/office/
desknet's NEO V2(desknet'sクラウド)
・スケジュールの共有・管理
・共用設備の予約管理
・メールの管理・送受信
・ファイル・ドキュメントの共有
・電子会議室・BBSの利用
・社内ソーシャル
・利用者名簿・社員名簿の共有
・連絡先・アドレス帳の共有
・インフォメーション・掲示板機能
・ポータル機能
・部門別のポータル作成
・画像対応コンテンツエディタ
【料金体系】
¥39,800/5ユーザー(スタンダードコース)
【王道の参考】
最新グループウェア徹底比較 機能編 - http://www.desknets.com/neo/rc_function.html
以上、最近めがねを買い換えようと考えている堀でした。
iosからgoogle+へのSNS共有
2.Create Client IDを作成
・[iOS] を選択します。
・[Bundle ID] フィールドに、アプリケーションのプロジェクト概要のパッケージ ID、この場合は com.google.GooglePlusSample を入力します。→【注意】自分で作成したプロジェクトのBundle ID
・[App Store ID] フィールドは空白のままにしておきます。このクイック スタート アプリは Apple ・iTunes App Store で公開されていないからです。
・[Deep Linking] の [Enabled] をクリックします。
・[Create client ID] ボタンをクリックします。
3.SDK内をダウンロード
Getting Started with the Google+ Platform for iOS - Google+ Platform for iOS — Google Developers - https://developers.google.com/+/mobile/ios/getting-started
4.SDK内のフォルダを追加
以下フォルダをXcodeに追加
・OpenSource
・GoogleOpenSource.framework※Freamworkとして、フォルダを追加
・GoogleOpenSource.framework※Freamworkとして、フォルダを追加
5.SDK内のファイルを追加
・GooglePlus.bundle
6.SDK内のFreamworkを追加
・SystemConfiguration.framework
・Security.framework
・CoreGraphics.framework
・CoreMotion.framework
7.ARCを自動設定している場合は、ファイルに対して、「-fno-objc-arc」を設定
Build Phase>Compile Sources でGTMとGTLから始まるファイルに「-fno-objc-arc」をつけていく。※GoogleOpenSourceには不要
8.Staticライブラリーでカテゴリで定義しているライブラリを読み込むように「-ObjC」のフラグを設定
→全てのオブジェクトファイルをロードするようリンカに促す。
たいていの場合実行ファイルのサイズが大きくなってしまいますが(アプリに追加のオブジェクトコードが読み込まれるので)、既存のクラスに対するカテゴリを含むObjective-C静的ライブラリを正しく使えるようになります。
Other Linker Flags: -ObjC
※ all_loadではない。
【補足】
以下エラーが出て、コンパイルが通らなかったので、Other Linker Flagsを外したら、コンパイル通った。従って、Other Linker Flagsの設定は行わない。(2014/03/22 現在)
※認証とshareのみ実装
clang: error: linker command failed with exit code 1 (use -v to see invocation)
9.取得したClient IDを設定
取得した
static NSString * const kClientId = @"YOUR_CLIENT_ID";
10.URLTYPEを設定
Info>URL Types
Bundle Identiferを設定
11.認証とShareを以下のように実装
googleplustestAppDelegate.h
#import <UIKit/UIKit.h> #import <GooglePlus/GooglePlus.h> @interface googleplustestAppDelegate : UIResponder <UIApplicationDelegate,GPPDeepLinkDelegate> @property (strong, nonatomic) UIWindow *window; @end
googleplustestAppDelegate.m
import "googleplustestAppDelegate.h"
@implementation googleplustestAppDelegate
- (BOOL)application: (UIApplication *)application
openURL: (NSURL *)url
sourceApplication: (NSString *)sourceApplication
annotation: (id)annotation {
return [GPPURLHandler handleURL:url
sourceApplication:sourceApplication
annotation:annotation];
}
#pragma mark - GPPDeepLinkDelegate
- (void)didReceiveDeepLink:(GPPDeepLink *)deepLink {
// An example to handle the deep link data.
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Deep-link Data"
message:[deepLink deepLinkID]
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
return YES;
}
googleplustestViewController.h
#import <UIKit/UIKit.h> #import <GooglePlus/GooglePlus.h> @interface googleplustestViewController : UIViewController <GPPSignInDelegate> @end
#import "googleplustestViewController.h"
#import <GoogleOpenSource/GoogleOpenSource.h>
@interface googleplustestViewController ()
@end
static NSString * const kClientId = @"MY Client ID";
@implementation googleplustestViewController
- (void)viewDidLoad
{
[super viewDidLoad];
GPPSignIn *signIn = [GPPSignIn sharedInstance];
signIn.shouldFetchGooglePlusUser = YES;
//signIn.shouldFetchGoogleUserEmail = YES; // Uncomment to get the user's email
// You previously set kClientId in the "Initialize the Google+ client" step
signIn.clientID = kClientId;
// Uncomment one of these two statements for the scope you chose in the previous step
signIn.scopes = @[ kGTLAuthScopePlusLogin ]; // "https://www.googleapis.com/auth/plus.login" scope
//signIn.scopes = @[ @"profile" ]; // "profile" scope
// Optional: declare signIn.actions, see "app activities"
signIn.delegate = self;
//[signIn authenticate];
[signIn trySilentAuthentication];
}
- (void)finishedWithAuth: (GTMOAuth2Authentication *)auth
error: (NSError *) error
{
NSLog(@"Received error %@ and auth object %@",error, auth);
if (error) {
// Do some error handling here.
} else {
[self refreshInterfaceBasedOnSignIn];
}
}
- (IBAction)shareButtonTapped:(id)sender {
id<GPPShareBuilder> shareBuilder = [[GPPShare sharedInstance] shareDialog];
[shareBuilder setPrefillText:@"Share!"];
[shareBuilder setURLToShare:[NSURL URLWithString:@"http://apple.com"]];
[shareBuilder open];
}【参考】
Google+ Sign-In for iOS - Google+ Platform for iOS — Google Developers - https://developers.google.com/+/mobile/ios/sign-in
※日本語より英語の方がわかりやすい
Objective-C - Google+ Platform on iOS のプロジェクトへのインストール - Qiita - http://qiita.com/mag4n/items/ed97b3ff9fb486df3099
GPPShare クラス リファレンス - Google+ Platform for iOS — Google Developers - https://developers.google.com/+/mobile/ios/api/interface_g_p_p_share?hl=ja
※リファレンス
ビルド設定の "Other Linker Flags" に "-ObjC" を設定する意味 - Over&Out その後 - http://d.hatena.ne.jp/shu223/20110426/1304694650
→staticライブラリーを使用する場合に「-ObjC」を設定する意味
以上、無精ひげは5日以上の伸ばすとかっこよく見えるとの話を聞いた堀でした。(無精ひげ2日目)
iosからのPinterest共有について
Pinterestへのpin共有について必要になったから調査
以下、手順で行う。
1.PinterestでClient IDを作成する。
→Pinterestアカウントを取得して、Client IDを取得しましょう。
pin<clientid>
Example if your client id is 18571937652947:
pin18571937652947 is the URL Scheme you need to support.※URLスキームとして使用されるようです。
2.Pinterest.embeddedframeworkフォルダ配下をプロジェクトに追加する
※Pinterest.frameworkをFrameworksに追加することもお忘れなく
3.使用するファイルにインポート
#import <Pinterest/Pinterest.h>
4.実装
イベントに以下のように記載
pinterest = [[Pinterest alloc]initWithClientId:@"取得したClient ID"];
NSURL *imageURL = [NSURL URLWithString:@"http://placekitten.com/500/400"];
NSURL *sourceURL = [NSURL URLWithString:@"http://placekitten.com"];
[pinterest createPinWithImageURL:imageURL
sourceURL:sourceURL
description:@"Pinning from Pin It Demo"];※画像イメージ、URL、説明を引数に渡す
5.ボタンへの実装
UIButton* pinItButton = [Pinterest pinItButton];
[pinItButton addTarget:self
action:@selector(pinIt:)
forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:pinItButton]; - (void)pinIt:(id)sender
{
[_pinterest createPinWithImageURL:@"http://placekitten.com/500/400"
sourceURL:@"http://placekitten.com"
description:@"Pinning from Pin It Demo"];
}【参考】
Pinterest - https://developers.pinterest.com/ios/
Pinterest — Socialize iOS SDK 3.0.1 documentation - http://socialize.github.io/socialize-sdk-ios/pinterest.html
iphone - How to integrate Pinterest in ios application - Stack Overflow - http://stackoverflow.com/questions/17011528/how-to-integrate-pinterest-in-ios-application
以上、生活費日本の1/3なら、セブ島に一度行ってみたいなと思った食べ物の好き嫌いが多い堀でした。