NSInteger row = indexPath.row;
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:1 inSection:1];
DataGroup *selectedObject = [[self fetchedResultsController] objectAtIndexPath:editGroupNo]; NSMutableArray *editArray = selectedObject.arrayObject; DataObject *editData = [[DataObject alloc]init]; [editArray addObject:editData]; NSMutableArray *saveArray = [NSMutableArray array]; NSInteger cnt,loopMax; loopMax = editArray.count; for (cnt=0; cnt<loopMax; cnt++) { [saveArray addObject:[editArray objectAtIndex:cnt]]; } selectedObject.pinArrayObject = saveArray; // saveメソッドで更新状態を確定 error = nil; if (![context save:&error]) { NSLog(@"error = %@", error); abort(); }
DataGroup *selectedObject = [[self fetchedResultsController] objectAtIndexPath:editGroupNo]; NSMutableArray *editArray = selectedObject.arrayObject; DataObject *editData = [editArray objectAtIndex:editItemNo]; selectedObject.pinArrayObject = nil; // saveメソッドで更新状態を確定 error = nil; if (![context save:&error]) { NSLog(@"error = %@", error); abort(); } editData.itemName = @"変更後の文字列"; NSMutableArray *saveArray = [NSMutableArray array]; NSInteger cnt,loopMax; loopMax = editArray.count; for (cnt=0; cnt<loopMax; cnt++) { [saveArray addObject:[editArray objectAtIndex:cnt]]; } selectedObject.pinArrayObject = saveArray; // saveメソッドで更新状態を確定 error = nil; if (![context save:&error]) { NSLog(@"error = %@", error); abort(); }
self.tableView.backgroundColor = [UIColor whiteColor];
- (void)encodeWithCoder:(NSCoder*)coder { [coder encodeInteger:_itemNo forKey:@"itemNo"]; [coder encodeObject:_itemName forKey:@"itemName"]; [coder encodeDouble:_itemDouble forKey:@"itemDouble"]; } - (id)initWithCoder:(NSCoder*)decoder { self = [super init]; _itemNo = [decoder decodeIntegerForKey:@"workOfArt"]; _itemName = [decoder decodeObjectForKey:@"itemName"]; _itemDouble = [decoder decodeDoubleForKey:@"itemDouble"]; return self; }
-(void)sample { self.view.frame = CGRectMake(start_positionX,start_positionY,start_sizeX,start_sizeY); [UIView animateWithDuration:1.0f delay:0.0f options:UIViewAnimationOptionCurveEaseIn animations:^{ // アニメーションをする処理 self.view.frame = CGRectMake(positionX, positionY, sizeX, sizeY); } completion:^(BOOL finished){ // アニメーションが終わった後実行する処理
[self smile2]; }]; }
BOOL stop_flg; -(void)sample { stop_flg = NO; self.view.frame = CGRectMake(positionX, positionY, sizeX, sizeY); [self move]; } -(void)move { if(stop_flg == YES)return; [UIView animateWithDuration:1.0f delay:0.0f options:UIViewAnimationOptionCurveEaseIn animations:^{ // アニメーションをする処理 self.view.frame = CGRectMake(positionX+X, positionY+Y, sizeX, sizeY); } completion:^(BOOL finished){ // アニメーションが終わった後実行する処理見て分かるとは思うが、細かい動きの連続で、それぞれの動作の開始前(後でもよい)に停止すべきかの判断を行う。
[self move]; }]; } -(void)stop { stop_flg = YES; }