ラベル iOS の投稿を表示しています。 すべての投稿を表示
ラベル iOS の投稿を表示しています。 すべての投稿を表示

2013年4月4日木曜日

StoryBoard push segue sample

1 StoryBoard によりButtonを配置して、右クリックしながら次の ControllerViewの画面までドラッグし、modalと接続することでコードの記述なしで画面の遷移を実装することができます。
  1. push segue (push セグエ)
    NavigationBarを用意して画面遷移をする場合に利用する。
    NavigationBarを用意せずに、Push形式でSegueを作成してはいけません。
  2. modal segue (modal セグエ)
    NavigationBarを使わずにビュー間を移動する場合に利用する。
    Modalセグエ(モーダル セグエ)で遷移すると、ソースビュー(遷移元ビュー)の上にターゲットビュー(遷移先ビュー)が生成され重ねられます。従って、モーダルでループ遷移は作らないようにしてください。
  3. custom segue (custom セグエ)
    UIStoryboardSegueクラスを継承したサブクラスを作成することで、トランジション効果を独自に演出することができます
  4. relation ship (関係:リレーション)
    リレーションはシーンとシーンをつなぐ接続の一種ですが、セグエではありません。
    TabBarControllerと各Tabbarのボタンに関連付けられてる子ビューをつなげる場合などに使います。























2.  tab sample





















3  push sample

先頭の NavigationControllerなしで push を使用すると以下のようなエラーとなります

*** Terminating app due to uncaught exception 'NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController.'























参考


画面間のデータの受け渡し

Storyboard上でビュー上に配置したボタンを右クリックしながら遷移させたいビューまでドラッグして接続するだけです。このときにpush, modal, customの3つの遷移の仕方が選べます。pushは次のビューが右から左に出てくるエフェクトで、modalは下から上に出てくるエフェクトです。customは自分でこのエフェクトを作成するときに使います。
http://d.hatena.ne.jp/Kesin/20120908/1347079921

2013年3月20日水曜日

phonegap-facebook-plugin



















phoneGap 2.5 
+ phonegap-facebook-plugin + facebook SDK3.2 Xcode 4.6.1 iOS(phoneGap)で facebook の
javascript SDKを動かす 




まず、phoneGapをインストールして
コマンドラインより、Xcode の
プロジェクトを作成 作成したプロジェクトを実行してみる






ダウロードした phoneGap の zip ファイルを解凍し、
解凍したディレクトリに移動して create を実行
$ cd phonegap-2.5.0/
$ ./lib/ios/bin/create ./HelloFBjs HelloFBjs HelloFBjs



作成された project を Xcode で開き、
実行してエラーがないことを確認
一部、警告が表示されるが 表示部分をコメントアウトして
config.xml に同等の内容を追記













































appId を設定し fql も動作OK

           document.addEventListener('deviceready', function() {
                                      try {
                                      alert('Device is ready! Make sure you set your app_id below this alert.');
                                      FB.init({ appId: "XXXXX", nativeInterface: CDV.FB, useCachedDialogs: false });
                                      document.getElementById('data').innerHTML = "";
                                      } catch (e) {
                                      alert(e);
                                      }
                                      }, false);



   *     FB.login(function(response) {
   *       if (response.authResponse) {
   *         // if you need to know which permissions were granted then
   *         // you can can make an fql-call
   *         FB.api({
   *                  method: 'fql.query',
   *                  query: 'select read_stream, publish_stream, ' +
   *                    'offline_access from permissions where uid=me()'
   *                },
   *                function (data) {
   *                  if (data[0].read_stream) {
   *                    // we have read_stream
   *                  }
   *                });
   *       } else {
   *         // user is not logged in
   *       }
   *     }, {scope:'read_stream, publish_stream, offline_access'});

2013年3月19日火曜日

PhoneGap 2.5 and WebKitStoreWebDataForBackup

WebKitStoreWebDataForBackup は NSUserDefaultsに設定する
バンドルされる XXX-info.plist ではない


http://developer.apple.com/library/ios/#releasenotes/General/RN-iOSSDK-6_0/index.html
In iOS 6 and later, web data (SQL Web Storage and LocalStorage) from a UIWebView object can be stored in a directory that will be backed up. To enable backing up this data, set the WebKitStoreWebDataForBackup key to YES in your app’s user defaults. This should be done only if your app relies on web content data that cannot be reloaded. If your UIWebView object opens links to arbitrary web content, this key should be set to NO. Toggling the value of this key will not preserve existing web view data.

$ ./lib/ios/bin/create ./HelloWorld org.apache.cordova.HelloWorld HelloWorld
$ pwd
/Users/XXX/phonegap-2.5.0

 [[NSUserDefaults standardUserDefaults] setBool:[backupType isEqualToString:@"cloud"] forKey:@"WebKitStoreWebDataForBackup"];

 backupType = @"cloud"

 

http://phonegap-fan.com/ use Splashscreen is deprecated. http://docs.phonegap.com/en/2.5.0/cordova_splashscreen_splashscreen.md.html#Splashscreen

2012年3月8日木曜日

iOS5.1 purges SQLite file

iOS Data Storage Guidelines

addSkipBackupAttributeToItemAtURL
https://developer.apple.com/library/ios/#qa/qa1719/_index.html
  https://developer.apple.com/icloud/documentation/data/

 1. Apple が想定する iCloud のバックアップ対象は <application_home>/Document 以下のフォルダである。

  1.1. 従って、このエリアに一時ファイルを置いアプリは審査の際に reject される。

2. <application_home>/Library/Caches が一時エリア

  2.1  SQLite のファイルは <application_home>/Library/WebKit 以下に作成されていたが iOS5.1 からは <application_home>/Library/Cache に変更された。

  2.2  SQLite は Apple は恒久的なストレージとは考えていないので、バックアップの対象としない。

Examples of files you should put in the Caches directory include database cache files and downloadable content, http://groups.google.com/group/phonegap/browse_thread/thread/4490b6a80f6c0e7c?pli=1 
I hope I am wrong, but after installing iOS5.1 beta2, I see that the app data of my phonegap app are now stored in the Library/Cache folder : See this screenshot my app data in iExplorer :http://cl.ly/1p3L1U2W1J3y3I1T1r3y (before it was in Library/WebKit folder).  

3. Apple が指定しる一時エリアは <application_home>/tmp

4. Use the "do not back up" attribute for specifying files that should remain on device, even in low storage situations.

Apple は かまわないでよ!属性 を用意したけれども、これでいままで SQLite のストレージが置かれていた <application_home>/Library/WebKit を指定したとしても、もうすでにそのファイルはすべて iOS Update の際に purge されてしまっている。
<application_home>/Library/Caches 以下を かまわないでよ!属性 に指定できるかもしれないが、できたとしてもあまり信用しないほうがいい。
* 属性指定後、現在 2012年10月 までのところ削除されていない。

Use this attribute with data that can be recreated but needs to persist even in low storage situations for proper functioning of your app or because customers expect it to be available during offline use.

This attribute works on marked files regardless of what directory they are in, including the Documents directory.

These files will not be purged and will not be included in the user's iCloud or iTunes backup.

Because these files do use on-device storage space, your app is responsible for monitoring and purging these files periodically.

Unityでドアの開閉はAnimatorそれともiTween?

Mac Mini M2 の Unity で Sketchup のデータを復元したつづき。 以前、苦労して作成したドアの開閉が動作しないので修復する。 どうやって動かしていたのか、また忘れそうなので記録しておく。             Animator 左右のドア PlaneL,...