スキップしてメイン コンテンツに移動

投稿

10月, 2013の投稿を表示しています

Attempt to dismiss from view controller

Warning: Attempt to dismiss from view controller <CustomNavigationViewController: 0x9ea3910> while a presentation or dismiss is in progress! 2013-10-30 13:01:27.204 Pins[517:70b] *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-2903.23/UITableView.m:1330 2013-10-30 13:01:27.429 Pins[517:70b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 0.  The number of rows contained in an existing section after the update (2) must be equal to the number of rows contained in that section before the update (2), plus or minus the number of rows inserted or deleted from that section (1 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).' *** First throw call stack: ( 0   CoreFoundation                      0x021ef5e...

open in safari / UISwitch add cell

if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateInactive) {         [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@" http://www.kit.ac.jp "]];     } [ self . tableView insertRowsAtIndexPaths :@[[ NSIndexPath indexPathForRow :1 inSection :0]] withRowAnimation : UITableViewRowAnimationAutomatic ]; [ self . tableView deleteRowsAtIndexPaths :@[[ NSIndexPath indexPathForRow :1 inSection :0]] withRowAnimation : UITableViewRowAnimationAutomatic ];

UILabel UITextField UITextView

UILabel : "The  UILabel  class implements a read-only text view." UITextField : "A  UITextField  object is a control that displays editable text and sends an action message to a target object when the user presses the return button." UITextView : "The  UITextView  class implements the behavior for a scrollable, multiline text region." So: labels are read-only textfields are editable, and provide horizontal character seeking (not really scrolling) when the text is too long to display all at once. Generally used to input short text. textviews are also editable, but provide vertical scrolling when the text is too long to display all at one.

Save

https://www.wantedly.com/projects/3846 http://dev.classmethod.jp/references/ios7-ibeacon-api/ http://www.devfright.com/ibeacons-tutorial-ios-7-clbeaconregion-clbeacon/

GPS for high accuracy

#import "SampleViewController.h" #define GPS_MEASURING_TIME 3.0 #define GPS_DESIRED_ACCURACY 100.0 #define GPS_UNADOPTABLE_ACCURACY 2000.0 // GPS測定開始処理。ここではView表示時に測定開始 - ( void )viewWillAppear:( BOOL )animated { locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self ; bestEffortAtLocation = nil ; locationManager.desiredAccuracy = GPS_DESIRED_ACCURACY; // GPS測定開始 [locationManager startUpdatingLocation]; // GPS_MEASURING_TIME 秒後に 測定終了(stopUpdatingLocation:)メソッドを実行 [ self performSelector: @selector (stopUpdatingLocation:) withObject: nil afterDelay:GPS_MEASURING_TIME]; NSLog( @"locationManager startUpdatingLocation" ); statusLable.text = @"GPS 取得中..." ; [activityIndicator startAnimating]; [ super viewWillAppear:animated]; } // GPS情報の処理。OSからGPS情報取得時に呼び出される - ( void )locationManager:(CLLocationManager *)manager ...

iBeacon

Turn Your iOS Device or Mac Into a Beacon Although third-party manufactures can create Bluetooth low energy beacons by programming the beacon’s identity values into the hardware itself, any iOS device or Mac that supports sharing data using Bluetooth low energy can be used as a beacon. Because turning your iOS device or Mac into a beacon requires the use of the Core Bluetooth framework, be sure to  link your app  to  CoreBluetooth.framework  in your Xcode project. To access the classes and headers of the framework, include an  #import <CoreBluetooth/CoreBluetooth.h>  statement at the top of any relevant source files. Creating and Advertising a Beacon Region To use your device as a beacon, you first need to generate a 128-bit UUID that you can use as your beacon region’s proximity UUID. Use the OS X command-line utility  uuidgen  to easily generate 128-bit UUIDs. To do so, open a window in Terminal. Next type  uuidgen  on t...

UIView CALayer

UIViewはCALayerを ひとつだけ持っています 。UIViewをアニメーションさせる場合は、その持っているCALayerクラスの「layer」というプロパティに対してアニメーションをさせる形になります。逆にCALayerは自分自身にいくつもCALayerを持つことができます。よく言われている「コンテナ」と「入れ子」の関係ですね。 また、UIViewはタッチイベントを受け取ることができますが、CALayerはタッチイベントを受け取ることができないようです。 上の記述と参考記事から簡単にまとめます。 UIView CALayerを一つだけ持っている UIViewをいくつも持てる(コンテナ。UIViewをいくつも自分自身に吊るせる) タッチイベントを受け取ることができる CALayer CALayerはUIViewのプロパティに入っている CALayerをいくつも持てる(コンテナ。CALayerをいくつも自分自身に吊るせる) タッチイベントを受け取ることができない 描画処理だけを行うため、描画がUIViewに比べて速い

ipad iphone

- ( BOOL )application:( UIApplication *)application didFinishLaunchingWithOptions:( NSDictionary *)launchOptions {     self . window = [[ UIWindow alloc ] initWithFrame :[[ UIScreen mainScreen ] bounds ]];     // Override point for customization after application launch.     if ([[ UIDevice currentDevice ] userInterfaceIdiom ] == UIUserInterfaceIdiomPhone ) {         self . viewController = [[ mkViewController alloc ] initWithNibName : @"mkViewController_iPhone" bundle : nil ];     } else {         self . viewController = [[ mkViewController alloc ] initWithNibName : @"mkViewController_iPad" bundle : nil ];     }     self . window . rootViewController = self . viewController ;     [ self . window makeKeyAndVisible ];     return YES ; }