使用简单的方法按钮放大和缩小UIView的最佳方法是什么.(EI
(IBAction)zoomin:(int)distance
{
method here
}
(IBAction)zoomout:(int)distance
{
and here
}
Run Code Online (Sandbox Code Playgroud) 我正在使用Core Data模型和UITableViewController表视图.我的模型似乎工作得很好,但是当我向模型添加实体时,我的表视图没有更新.我相信我的模型正在工作的原因是因为当我添加一个实体时,在运行时没有任何内容显示在视图中,但是如果我剪切任务然后启动它,那么我之前创建的实体突然显示在表视图中.
这是我的表视图控制器 - AudioTableViewController.h
#import <UIKit/UIKit.h>
#import "Bank.h"
#import "Player.h"
@class Player;
@interface AudioTableViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource> {
Player *myMainMan;
}
-(void)addAudioEntityToArray:(AudioFile *)event;
-(NSMutableArray *)recordingsArray;
@end
Run Code Online (Sandbox Code Playgroud)
AudioTableViewController.m(实现文件)
#import "AudioTableViewController.h"
@implementation AudioTableViewController
-(void)addAudioEntityToArray:(AudioFile *)event {
NSIndexPath *indexPath;
if(event.type) {
[[MusikerViewController recordingsArray] addObject:event];//self?
indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
}else {
[[MusikerViewController downloadsArray] addObject:event];
indexPath = [NSIndexPath indexPathForRow:0 inSection:1];
}
[[self tableView] setEditing:YES animated:NO];
[self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:UITableViewRowAnimationNone];
}
- (void)viewDidLoad {
[[self tableView] reloadData];
[super viewDidLoad];
self.title = @"Audio Files";//put …
Run Code Online (Sandbox Code Playgroud)