月別アーカイブ: 2014年9月

CONSTRAINS

詳細画面については、上、左右の三箇所設定。
個々ののラベル等ではなく、VIEWに対して設定する。

UISCROLLVIEW

平成26年9月19日(火曜日)
画像(Image View)を背景とした場合の措置

  • Scroll View追加
  • その下位にView追加
  • Scroll View→add New constrain (上下左右 0 0 0 0)
  • 以下 上下のみに設定 ERRORの喚起あれど、今回のこのまま
  • View→ add New constrain (上下のみ 0 0 )
  • View→ width,height設定
  • View→Center X Alignment設定

文字列比較

[objc]
NSString *str1 = @"ABC";
NSString *str2 = @"ABC";

// 同じ文字列かを判定
if ([str1 isEqualToString:str1]) {
NSLog(@"同じ文字列です");
} else {
NSLog(@"異なる文字列です");
}
[/objc]

SearchBar

SearchBarの遷移先でObjectを変更すると、エラーになる件。
ERROR
2014-09-07 13:05:38.832 BeppuSpa88[13043:60b] mainview coredata exist don’t anything!!
2014-09-07 13:05:46.250 BeppuSpa88[13043:60b] *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-2935.137/UITableView.m:1352
2014-09-07 13:05:46.262 BeppuSpa88[13043:60b] CoreData: error: Serious application error. An exception was caught from the delegate of NSFetchedResultsController during a call to -controllerDidChangeContent:. Invalid update: invalid number of sections. The number of sections contained in the table view after the update (2) must be equal to the number of sections contained in the table view before the update (11), plus or minus the number of sections inserted or deleted (0 inserted, 0 deleted). with userInfo (null)

[objc]
//
@property Boolean IsSearchTable;
//
[/objc]

[objc]
//
@synthesize IsSearchTable;
//
[/objc]

NORMAL VIEW か SEARCHBARか確認した上で処理することで対応。

[objc]
//
//—————————————————————————-
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([[segue identifier] isEqualToString:@"showDetail"]) {
if(sender == self.searchDisplayController.searchResultsTableView) {
// サーチビュー
NSIndexPath *indexPath = [self.searchDisplayController.searchResultsTableView indexPathForSelectedRow];
NSManagedObject *object = [[self fetchedResultsController] objectAtIndexPath:indexPath];
[[segue destinationViewController] setDetailItem:object];

//SearchBarの遷移先でObjectを変更すると、エラーになる件についての対策
[[segue destinationViewController] setIsSearchTable:YES];
}
else {
// ノーマルビュー
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
NSManagedObject *object = [[self fetchedResultsController] objectAtIndexPath:indexPath];
[[segue destinationViewController] setDetailItem:object];

//SearchBarの遷移先でObjectを変更すると、エラーになる件についての対策
[[segue destinationViewController] setIsSearchTable:NO];
}
} else if ([[segue identifier] isEqualToString:@"showflip"]) {
[[segue destinationViewController] setDelegate:self];

// 現在のFetche_predicate_strをflipviewに通知。
[[segue destinationViewController] setFlipout_str:Fetche_predicate_str];
}
}
//—————————————————————————-
//
[/objc]

[objc]
//
//動作確認用
NSLog(@"IsSearchTable = %hhu",IsSearchTable);
//self.title=[NSString stringWithFormat:@"%@",[[_detailItem valueForKey:@"name"] description]];
//温泉入湯チェックボタン追加 of_off
//SearchBarにより遷移するとERROR発生。さて…とりあえずコメントアウト次なる手を。。。
//次の一手
if (IsSearchTable == NO) {
[_detailItem setValue:[NSNumber numberWithBool:YES] forKey:@"on_off"];
}
//—————————–
//
[/objc]

平成26年9月7日(日曜日)

DetailTableViewを非table版に変更。

segue → showDetail(push)

SearchBarの遷移先でObjectを変更すると、エラーになる件。
ERROR
2014-09-07 13:05:38.832 BeppuSpa88[13043:60b] mainview coredata exist don’t anything!!
2014-09-07 13:05:46.250 BeppuSpa88[13043:60b] *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-2935.137/UITableView.m:1352
2014-09-07 13:05:46.262 BeppuSpa88[13043:60b] CoreData: error: Serious application error. An exception was caught from the delegate of NSFetchedResultsController during a call to -controllerDidChangeContent:. Invalid update: invalid number of sections. The number of sections contained in the table view after the update (2) must be equal to the number of sections contained in the table view before the update (11), plus or minus the number of sections inserted or deleted (0 inserted, 0 deleted). with userInfo (null)

解決済み、SEARCHBARカテゴリ参照。

他に、
ラベルに表示されない件について
detail viewのviewDidLoadに[self configureView]を追加して、解決。

[objc]
– (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
[self configureView];
_view2.backgroundColor=[UIColor colorWithRed:0.96 green:0.96 blue:0.86 alpha:0.3];
}
[/objc]

画面遷移の変更

[objc]
MapViewController.m
//
//DetailTableViewController *mycontroller = [self.storyboard instantiateViewControllerWithIdentifier:@"registered"];
DetailTableViewController *mycontroller = [self.storyboard instantiateViewControllerWithIdentifier:@"registered2"];
//
[/objc]

OSX

スクリーンショット

平成26年9月6日
command (⌘) + shift + 4」キーを押して、十字ポインタをドラッグして領域を選択します。「shift」「option」または「space」バーを押しながらドラッグして、選択した領域のサイズを変更します。取り消すには、マウスボタンを放す前に「escape (esc)」キーを押します。

特定のウインドウのスクリーンショット
「command (⌘) + shift + 4」キーを押して「space」バーを押し、カメラのポインタをウインドウの上に移動してハイライトし、クリックします。

iphone画面のコピー(スクリーンショット)
ホームボタンとスリープボタンを同時に押す。