我在使用CGImageDestinationFinalize时遇到iOS问题.我将在CGImageDestinationRef上调用CGImageDestinationFinalize,我会收到以下警告
错误:函数`CGContextClear'已过时,将在即将发布的更新中删除.不幸的是,这个应用程序或它使用的库正在使用这个过时的功能,从而导致系统性能的整体下降.
看看乐器,当我调用CGImageDestinationFinalize时,我的内存使用率会上升(有时它会变得太高而崩溃).我不确定这个问题是否应该受到指责,但我已将其与CGImageDestinationFinalize的问题分开了
有关使用什么来避免调用CGContextClear的任何建议?或者如何使用CGImageDestinationFinalize减少内存使用量?
我正在尝试使用UITableView,我可以动态添加和删除行,并且行中有UITextField.为了添加行,我正在使用代码:
- (void) addRow
{
[nameArray addObject:[NSString stringWithFormat:@"%i", x]];
[self.tableView reloadData];
x++;
}
Run Code Online (Sandbox Code Playgroud)
我只是在计算nameArray以获取我在tableView中有多少行.然后,在cellForRowAtIndexPath内部,我有以下代码
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
...
/*Default Apple-y stuff*/
...
if ([indexPath row] == 0) {
playerTextFieldZero = [[UITextField alloc] initWithFrame:CGRectMake(20, 10, 185, 30)];
playerTextFieldZero.adjustsFontSizeToFitWidth = YES;
playerTextFieldZero.placeholder = @"Name";
playerTextFieldZero.textColor = [UIColor blackColor];
playerTextFieldZero.returnKeyType = UIReturnKeyDone;
playerTextFieldZero.backgroundColor = [UIColor whiteColor];
playerTextFieldZero.autocorrectionType = UITextAutocorrectionTypeNo; // no auto correction support
playerTextFieldZero.textAlignment = UITextAlignmentLeft;
playerTextFieldZero.tag = 0;
playerTextFieldZero.delegate = self;
playerTextFieldZero.clearButtonMode = UITextFieldViewModeNever; // no clear …Run Code Online (Sandbox Code Playgroud)