假设我们有600X400的图像,我们希望最终得到1000X100的新图像,其中包含中心的初始图像和周围的透明空间.我怎样才能在代码中实现这一点?

我正在使用ARC开发应用程序当在仪器中分析我的应用程序以进行内存泄漏时,它会在以下函数中显示泄漏:
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
Run Code Online (Sandbox Code Playgroud)
这是否表明我的代码中的其他地方存在问题?
这是堆栈跟踪
0 libsystem_c.dylib malloc
1 libsystem_c.dylib strdup
2 libnotify_sim.dylib token_table_add
3 libnotify_sim.dylib notify_register_mach_port
4 libnotify_sim.dylib notify_register_dispatch
5 CoreFoundation _CFXNotificationRegisterObserver
6 CoreFoundation CFNotificationCenterAddObserver
7 UIKit -[UIScrollView(Static) _startTimer:]
8 UIKit -[UIScrollView _endPanWithEvent:]
9 UIKit -[UIScrollView handlePan:]
10 UIKit _UIGestureRecognizerSendActions
11 UIKit -[UIGestureRecognizer _updateGestureWithEvent:]
12 UIKit -[UIGestureRecognizer _delayedUpdateGesture]
13 UIKit ___UIGestureRecognizerUpdate_block_invoke_0541
14 UIKit _UIGestureRecognizerApplyBlocksToArray
15 UIKit _UIGestureRecognizerUpdate
16 UIKit -[UIWindow _sendGesturesForEvent:] …Run Code Online (Sandbox Code Playgroud) 当用户按下按钮时,我使用以下代码获取我的位置
[mapview setShowsUserLocation:YES];
Run Code Online (Sandbox Code Playgroud)
接下来将地图居中到te用户的位置
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
{
[mapView setCenterCoordinate:mapView.userLocation.location.coordinate animated:YES];
}
Run Code Online (Sandbox Code Playgroud)
我的问题是如何防止地图始终以我的位置为中心?我想允许用户平移地图.