iPhone 多点触控与 CorePlot 交互

2023-12-29

我正在开发一个带有核心图图表的 iPhone 应用程序。在一些教程的帮助下,我成功地通过单击和拖动来完成此操作。如何通过多次触摸和拖动来实现它?有人请帮帮我吗?

视图控制器.m

- (void)viewDidLoad
{
    [super viewDidLoad];

    EskPlotTheme *defaultTheme = [[EskPlotTheme alloc] init];
    linePlot = [[EskLinePlot alloc] init];
    linePlot.delegate = self;
    [linePlot renderInLayer:lineHostingView withTheme:defaultTheme]; 
    [defaultTheme release];    
}

EskLinePlot.m

- (id)init
{
    self = [super init];
    if (self) 
    {
        // setting up the sample data here.
        sampleData = [[NSArray alloc] initWithObjects:[NSNumber numberWithInt:6000],
                                                      [NSNumber numberWithInt:3000],
                                                      [NSNumber numberWithInt:2000],
                                                      [NSNumber numberWithInt:5000],
                                                      [NSNumber numberWithInt:7000],
                                                      [NSNumber numberWithInt:8500],
                                                      [NSNumber numberWithInt:6500], nil];

    }
    return self;
}

- (void)renderInLayer:(CPTGraphHostingView *)layerHostingView withTheme:(CPTTheme *)theme
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

    CGRect bounds = layerHostingView.bounds;

    // Create the graph and assign the hosting view.
    graph = [[CPTXYGraph alloc] initWithFrame:bounds];
    layerHostingView.hostedGraph = graph;
    [graph applyTheme:theme];

    graph.plotAreaFrame.masksToBorder = NO;

    // chang the chart layer orders so the axis line is on top of the bar in the chart.
    NSArray *chartLayers = [[NSArray alloc] initWithObjects:[NSNumber numberWithInt:CPTGraphLayerTypePlots],
                                                            [NSNumber numberWithInt:CPTGraphLayerTypeMajorGridLines], 
                                                            [NSNumber numberWithInt:CPTGraphLayerTypeMinorGridLines],  
                                                            [NSNumber numberWithInt:CPTGraphLayerTypeAxisLines], 
                                                            [NSNumber numberWithInt:CPTGraphLayerTypeAxisLabels], 
                                                            [NSNumber numberWithInt:CPTGraphLayerTypeAxisTitles], 
                                                            nil];
    graph.topDownLayerOrder = chartLayers;    
    [chartLayers release];

    // Add plot space for horizontal charts
    graph.paddingLeft = 60.0;
    graph.paddingTop = 70.0;
    graph.paddingRight = 20.0;
    graph.paddingBottom = 20.0;

    // Setup plot space
    CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace;
    plotSpace.allowsUserInteraction = YES;
    plotSpace.delegate = self;
    int sampleCount = [sampleData count]-1;
    plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) length:CPTDecimalFromFloat(sampleCount)];
    plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) length:CPTDecimalFromFloat(10000)];

    // Setup grid line style
    CPTMutableLineStyle *majorXGridLineStyle = [CPTMutableLineStyle lineStyle];
    majorXGridLineStyle.lineWidth = 1.0f;
    majorXGridLineStyle.lineColor = [[CPTColor whiteColor] colorWithAlphaComponent:0.25f];

    CPTMutableTextStyle *whiteTextStyle = [[[CPTMutableTextStyle alloc] init] autorelease];
    whiteTextStyle.color = [CPTColor whiteColor];    

    // Setup x-Axis.
    CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet;
    CPTXYAxis *x = axisSet.xAxis;
    x.majorGridLineStyle = majorXGridLineStyle;
    x.labelTextStyle = whiteTextStyle;
    x.majorIntervalLength = CPTDecimalFromString(@"1");
    x.minorTicksPerInterval = 1;

    NSArray *exclusionRanges = [NSArray arrayWithObjects:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromInt(0) length:CPTDecimalFromInt(0)], nil];
    x.labelExclusionRanges = exclusionRanges;

    // Setup y-Axis.
    CPTMutableLineStyle *majorYGridLineStyle = [CPTMutableLineStyle lineStyle];
    majorYGridLineStyle.lineWidth = 1.0f;
    majorYGridLineStyle.lineColor = [[CPTColor whiteColor] colorWithAlphaComponent:0.25];

    CPTMutableLineStyle *minorYGridLineStyle = [CPTMutableLineStyle lineStyle];
    minorYGridLineStyle.lineWidth = 1.0f;
    minorYGridLineStyle.lineColor = [[CPTColor blackColor] colorWithAlphaComponent:0.1];

    CPTXYAxis *y = axisSet.yAxis;
    y.majorGridLineStyle = majorYGridLineStyle;
    y.minorGridLineStyle = minorYGridLineStyle;
    y.labelTextStyle = whiteTextStyle;
    y.majorIntervalLength = CPTDecimalFromString(@"1000");
    y.minorTicksPerInterval = 1;
    y.orthogonalCoordinateDecimal = CPTDecimalFromString(@"0");
    NSArray *yExlusionRanges = [NSArray arrayWithObjects:
                                [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0) length:CPTDecimalFromFloat(0.0)],
                                nil];
    y.labelExclusionRanges = yExlusionRanges;

    // Create a high plot area
    CPTScatterPlot *highPlot = [[[CPTScatterPlot alloc] init] autorelease];
    highPlot.identifier = kHighPlot;

    CPTMutableLineStyle *highLineStyle = [[highPlot.dataLineStyle mutableCopy] autorelease];
    highLineStyle.lineWidth = 2.f;
    highLineStyle.miterLimit        = 1.0f;
    highLineStyle.lineColor = [CPTColor whiteColor];
    highPlot.dataLineStyle = highLineStyle;
    highPlot.dataSource = self;

    CPTColor *areaColor1       = [[CPTColor whiteColor] colorWithAlphaComponent:0.8f];
    CPTGradient *areaGradient1 = [CPTGradient gradientWithBeginningColor:areaColor1 endingColor:[[CPTColor whiteColor]  colorWithAlphaComponent:0.2f]];
    areaGradient1.angle = -90.0f;
    CPTFill *areaGradientFill = [CPTFill fillWithGradient:areaGradient1];
    highPlot.areaFill       = areaGradientFill;
    highPlot.areaBaseValue = [[NSDecimalNumber zero] decimalValue];
    [graph addPlot:highPlot];

    // Create the Savings Marker Plot
    selectedCoordination = 2;

    touchPlot = [[[CPTScatterPlot alloc] initWithFrame:CGRectNull] autorelease];
    touchPlot.identifier = kLinePlot;
    touchPlot.dataSource = self;
    touchPlot.delegate = self;
    [self hideTouchPlotColor];
    [graph addPlot:touchPlot];

    [pool drain];

}

- (void)hideTouchPlotColor
{
    CPTColor *touchPlotColor = [CPTColor clearColor];

    CPTMutableLineStyle *savingsPlotLineStyle = [CPTMutableLineStyle lineStyle];
    savingsPlotLineStyle.lineColor = touchPlotColor;

    CPTPlotSymbol *touchPlotSymbol = [CPTPlotSymbol ellipsePlotSymbol];
    touchPlotSymbol.fill = [CPTFill fillWithColor:touchPlotColor];
    touchPlotSymbol.lineStyle = savingsPlotLineStyle;
    touchPlotSymbol.size = CGSizeMake(12.0f, 12.0f);

    CPTMutableLineStyle *touchLineStyle = [CPTMutableLineStyle lineStyle];
    touchLineStyle.lineColor = [CPTColor clearColor];
    touchLineStyle.lineWidth = 1.0f;

    CPTMutableLineStyle *symbolLineStyle = [CPTMutableLineStyle lineStyle];
    symbolLineStyle.lineColor = [CPTColor clearColor];
    CPTPlotSymbol *plotSymbol = [CPTPlotSymbol ellipsePlotSymbol];
    plotSymbol.fill = [CPTFill fillWithColor:[CPTColor clearColor]];
    plotSymbol.lineStyle = symbolLineStyle;
    plotSymbol.size = CGSizeMake(10.0, 10.0);
    touchPlot.plotSymbol = plotSymbol;

    touchPlot.dataLineStyle = touchLineStyle;
}

// Assign different color to the touchable line symbol.
- (void)showTouchPlotColor
{
    CPTColor *touchPlotColor = [CPTColor orangeColor];

    CPTMutableLineStyle *savingsPlotLineStyle = [CPTMutableLineStyle lineStyle];
    savingsPlotLineStyle.lineColor = touchPlotColor;

    CPTPlotSymbol *touchPlotSymbol = [CPTPlotSymbol ellipsePlotSymbol];
    touchPlotSymbol.fill = [CPTFill fillWithColor:touchPlotColor];
    touchPlotSymbol.lineStyle = savingsPlotLineStyle;
    touchPlotSymbol.size = CGSizeMake(12.0f, 12.0f); 

    CPTMutableLineStyle *touchLineStyle = [CPTMutableLineStyle lineStyle];
    touchLineStyle.lineColor = [CPTColor orangeColor];
    touchLineStyle.lineWidth = 1.0f;

    CPTMutableLineStyle *symbolLineStyle = [CPTMutableLineStyle lineStyle];
    symbolLineStyle.lineColor = [CPTColor blackColor];
    CPTPlotSymbol *plotSymbol = [CPTPlotSymbol ellipsePlotSymbol];
    plotSymbol.fill = [CPTFill fillWithColor:[CPTColor orangeColor]];
    plotSymbol.lineStyle = symbolLineStyle;
    plotSymbol.size = CGSizeMake(10.0, 10.0);
    touchPlot.plotSymbol = plotSymbol;

    touchPlot.dataLineStyle = touchLineStyle;
}

// This method is call when user touch & drag on the plot space.
- (BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(id)event atPoint:(CGPoint)point
{
    // Convert the touch point to plot area frame location
    CGPoint pointInPlotArea = [graph convertPoint:point toLayer:graph.plotAreaFrame];

    NSDecimal newPoint[2];
    [graph.defaultPlotSpace plotPoint:newPoint forPlotAreaViewPoint:pointInPlotArea];
    NSDecimalRound(&newPoint[0], &newPoint[0], 0, NSRoundPlain);
    int x = [[NSDecimalNumber decimalNumberWithDecimal:newPoint[0]] intValue];

    if (x < 0)
    {
        x = 0;
    }
    else if (x > [sampleData count])
    {
        x = [sampleData count];
    }

        selectedCoordination = x;
        if ([delegate respondsToSelector:@selector(linePlot:indexLocation:)])
            [delegate linePlot:self indexLocation:x];
        [touchPlot reloadData];

    return YES;
}

- (BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(id)event 
          atPoint:(CGPoint)point
{
    [self showTouchPlotColor];
    return YES;
}

- (BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceUpEvent:(id)event atPoint:(CGPoint)point
{
    [self hideTouchPlotColor];
    touchPlotSelected = NO;
    return YES;
}

#pragma mark - 
#pragma mark Scatter plot delegate methods

- (void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index
{
    if ([(NSString *)plot.identifier isEqualToString:kLinePlot]) 
    {
        touchPlotSelected = YES;
        [self applyHighLightPlotColor:plot];
        if ([delegate respondsToSelector:@selector(linePlot:indexLocation:)])
            [delegate linePlot:self indexLocation:index];
    } 
}

#pragma mark -
#pragma mark Plot Data Source Methods

- (NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot 
{
    if ([(NSString *)plot.identifier isEqualToString:kLinePlot]) 
    {
        return kNumberOfMarkerPlotSymbols;
    }
    else {
        return [sampleData count];
    }
}

- (NSNumber *)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index 
{
    NSNumber *num = nil;
    if ( [(NSString *)plot.identifier isEqualToString:kHighPlot] )
    {
        if ( fieldEnum == CPTScatterPlotFieldY ) 
        {
            num = [sampleData objectAtIndex:index];
        } 
        else if (fieldEnum == CPTScatterPlotFieldX) 
        {
            num = [NSNumber numberWithInt:index];
        }
    }
    else if ([(NSString *)plot.identifier isEqualToString:kLinePlot]) 
    {
        if ( fieldEnum == CPTScatterPlotFieldY ) 
        {
            switch (index) {
                case 0:
                    num = [NSNumber numberWithInt:-1000];
                    break;
                case 2:
                    num = [NSNumber numberWithInt:12700];
                    break;
                default:
                    num = [sampleData objectAtIndex:selectedCoordination];
                    break;
            }
        } 
        else if (fieldEnum == CPTScatterPlotFieldX) 
        {
            num = [NSNumber numberWithInt:selectedCoordination];
        }
    }

    return num;
}

我最近遇到了同样的问题,但找不到任何解决方案。经过一段时间的研究和编码后,我找到了一些解决方案,并想分享一个非常简单的解决方案,因此它可能会帮助您了解如何解决此问题。

我创建了透明的 UIView,并将其放在 CPTGraphHostingView 之上。 该视图正在处理所需的触摸事件。 我们将其命名为 TestView

TestView.h 文件看起来像

@protocol TestViewDelegate <NSObject>
- (void)myTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)myTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)myTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;

@end

@interface TestView : UIView
@property (nonatomic, weak) id <TestViewDelegate>delegate;
@end

测试视图.m

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    [self.delegate myTouchesBegan:touches withEvent:event];
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
    [self.delegate myTouchesMoved:touches withEvent:event];
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
    [self.delegate myTouchesEnded:touches withEvent:event];
}

TestView 委托(在我的例子中是 viewController,其中包括 corePlot 托管视图)将实现这些方法并查看下面的代码示例

- (void)myTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
    if (touches.count == 1) {
        UITouch *touch = (UITouch *)[[touches allObjects] objectAtIndex:0];
        CGPoint point = [touch locationInView:nil];
        [self plotSpace:self.plotSpace shouldHandlePointingDeviceDraggedEvent:event atPoint:point];
    }
    if (touches.count == 2) {
        UITouch *touch = (UITouch *)[[touches allObjects] objectAtIndex:1];
        CGPoint point = [touch locationInView:nil];
        [self plotSpace:self.plotSpace shouldHandlePointingDeviceDraggedEvent:event atPoint:point];
    }
}

viewController 中的 CTPlotSpace 委托方法如下所示

- (BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(id)event atPoint:(CGPoint)point{
    NSSet *allTouches = [event allTouches];
    if ([allTouches count] >0 ) {
        UITouch *touch1 = [[allTouches allObjects] objectAtIndex:0];
        if (touch1){
            CGPoint pointInPlotArea = [self.graph convertPoint:[touch1 locationInView:self.view] toLayer:self.graph.plotAreaFrame];
//              padding
            pointInPlotArea.x -=10;
            NSDecimal newPoint[2];
            [self.graph.defaultPlotSpace plotPoint:newPoint forPlotAreaViewPoint:pointInPlotArea];
            NSDecimalRound(&newPoint[0], &newPoint[0], 0, NSRoundPlain);
            int x = [[NSDecimalNumber decimalNumberWithDecimal:newPoint[0]] intValue];
            x--;

            if (x <= 0)
                x = 0;
            else if (x >= [self.currentDatapoints count])
                x = [self.currentDatapoints count] - 1;

            selectedCoordination = x;
            self.label.text = [NSString stringWithFormat:@"%@", [self.currentDatapoints objectAtIndex:x]];
            self.differenceLabel.text = @"";
            [touchPlot reloadData];
        }
        if ([allTouches count] > 1){
            secondTouchPlot.hidden = NO;
            UITouch *touch2 = [[allTouches allObjects] objectAtIndex:1];
            if (touch2) {
                CGPoint pointInPlotArea = [self.graph convertPoint:[touch2 locationInView:self.view] toLayer:self.graph.plotAreaFrame];
                pointInPlotArea.x -= 10;
                NSDecimal newPoint[2];
                [self.graph.defaultPlotSpace plotPoint:newPoint forPlotAreaViewPoint:pointInPlotArea];
                NSDecimalRound(&newPoint[0], &newPoint[0], 0, NSRoundPlain);
                int x = [[NSDecimalNumber decimalNumberWithDecimal:newPoint[0]] intValue];
                x--;
                if (x <= 0)
                    x = 0;
                else if (x >= [self.currentDatapoints count])
                    x = [self.currentDatapoints count] - 1;

                selectedCoordination2 = x;
                self.secondLabel.text = [NSString stringWithFormat:@"%@", [self.currentDatapoints objectAtIndex:x]];
                [secondTouchPlot reloadData];
                float first = [self.label.text floatValue];
                float second = [[self.currentDatapoints objectAtIndex:x] floatValue];
                self.differenceLabel.textColor = (first - second) > 0 ? [UIColor greenColor] : [UIColor redColor];
                self.differenceLabel.text = [NSString stringWithFormat:@"%f", first - second];

            }
        }
    }
    return YES;
}

这就是结果......

这不是优化的代码,这只是我上面提到的如何解决这个问题的想法。

希望能帮助到你...

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

iPhone 多点触控与 CorePlot 交互 的相关文章

  • ARC 不允许将 Objective-C 指针隐式转换为“void *”

    这意味着什么 我有什么选择 ARC 不允许将 Objective C 指针隐式转换为 void 我正在将 Xcode3 项目移植到 iOS5 它使用 AudioSessionInitialize 如下 AudioSessionInitial
  • ios 在后台处理推送通知

    我想保存应用程序处于后台状态时到达的推送通知 我知道关于 void application UIApplication application didReceiveRemoteNotification NSDictionary userIn
  • 从什么时候起 Xcode 不再需要前向方法声明,为什么?

    我注意到 Xcode 或更准确地说是 Apple LLVM 编译器 不再需要前向方法声明 换句话说 构建以下代码时不会发出警告 implementation Foo void foo self bar void bar end 这曾经发出警
  • 如何使用 Core Graphics 在我的触摸位置绘制一个圆圈?

    新程序员来了 我在尝试使用 Core Graphics 在触摸位置周围绘制描边弧时遇到问题 我有绘制圆圈的方法工作正常 并且我已经测试并在点击屏幕时注册触摸 但是当我尝试在点击时调用绘制圆圈的方法时 我收到错误 CG ContextBlah
  • XCode 4.5 给我“SenTestingKit/SenTestKit.h”文件未找到,但适用于 4.4.1

    我刚刚安装了 XCode 4 5 它在我现有的项目之一上给了我一个 SenTestingKit SenTestingKit h 文件未找到错误 此错误仅发生在 XCode 4 5 中 但它在 4 4 1 上编译正常 我已经检查过SenTes
  • 高效创建 x 层深度的嵌套 for 循环

    这可能是一件简单的事情 但我需要创建一个循环结构 使其循环 y x 次以创建 x 和 y 的所有可能组合 例如 如果有 4 个 x 每个 x 有 2 个 y 我想做这样的事情 for int a 0 a lt y a for int b 0
  • 将 UIButton 中的图像缩放到 AspectFit?

    我想将图像添加到 UIButton 并且还想缩放图像以适合 UIButton 使图像变小 请告诉我该怎么做 这是我尝试过的 但它不起作用 将图像添加到按钮并使用setContentMode self itemImageButton setI
  • ios 导航 堆栈操作

    我在尝试从 iOS 应用程序操作导航堆栈时遇到问题 或者至少是由于这种操纵而产生的行为 我的情况 我有 3 个 ViewController 控制器a显示多个级别 控制器 b 是游戏视图 控制器 c 是某种分数 显然 我将在控制器 a 中选
  • 使用 json 向 RESTful WCF 发送 Post 请求

    我已经尝试了每种组合来发送请求 以从 jQuery 向 RESTful WCF 发送 POST 请求 有人可以模仿并使其发挥作用吗 代码在这里 http pastebin com Ua97919C http pastebin com Ua9
  • UIDocumentInteractionController 阻止“打开方式”表中的空投

    在我的应用程序中 我允许用户通过 Instagram 分享照片 这需要使用 UIDocumentInteractionController 如果手机支持 则会自动检测空投 如何将其从 打开方式 操作表中删除 即使我使用 UIActivity
  • 自定义 UITableViewCell 选择样式?

    当我点击我的UITableViewCell 当我单击单元格时 背景部分 我的背景图像未覆盖的区域 会变成蓝色 另外 所有的UILabel单击时单元格上的 s 变为白色 这就是我想要的 然而 我不想要的是当我点击它时的蓝色背景 但如果我这样做
  • 使用 Interface Builder 创建 UIScrollView 的步骤

    我正在尝试使用 UIScrollView 但似乎有一些基本的事情我不理解 假设我想在我的 iPhone 应用程序中使用 UIScrollView 我有一个充满按钮的视图 尺寸为 320x700 显然 这对于 320x480 的 iPhone
  • UIScrollView - 启用分页后,我可以“更改”页面宽度吗?

    将滚动视图 将 pagingEnabled 设置为 YES 将页面宽度设置为滚动视图边界以外的其他值的最简单方法是什么 让我举个例子 假设我有一个包含 10 个项目的滚动视图 每个项目的宽度为 150 像素 而我的滚动视图的宽度为 300
  • iphone NSDate 转换问题

    在我的 facebook 图表 Api 中 我正在获取这些数据 来自杰森 updated time 2011 05 17T14 52 16 0000 我正在使用此代码将其转换为有效的日期格式 NSDateFormatter df NSDat
  • Xcode 中的 iOS 9 警告 - 此文件设置为针对早于项目部署的版本进行构建。功能可能有限

    我刚刚将我的 Mac 更新到最新的操作系统 并将 Xcode 更新到最新版本 现在我收到此警告 但我不知道该由谁来删除它 也不知道它的真正含义是什么 有人可以向我解释一下吗 Thanks Select Main storyboard in
  • 填充 CoreData 创建的 sqlite 数据库

    我有一个由 CoreData 模型自动创建的 sqlite DB 但我的应用程序不会让用户能够将数据写入其中 而是我想用程序所需的所有数据预先填充它 我的问题是 CoreData 创建的 sqlite DB 具有未知的表和字段 这些表和字段
  • 在 UIImage 顶部绘制透明圆圈 - iPhone SDK

    我在尝试找出如何在 UIImageView 中的 UIImage 顶部绘制透明圆圈时遇到了很多麻烦 谷歌给了我线索 但我仍然找不到有效的例子 有没有人知道的例子可以证明这一点 最简单的方法就是创建一个半透明的方形 UIView 然后将其图层
  • 通过 Instruments 使用 UIAutomation 操作 iphone 时,什么是 UIATargetHasGoneAWOLException。

    我正在使用 UIAutomation 通过 Xcode 中的 Instruments 在 iPhone 上执行某些操作 但遇到了一个奇怪的异常 UIATargetHasGoneAWOLException 有人知道这个异常是什么意思吗 我发现
  • iPhone 和加密库

    我想我必须在我的 iPhone 应用程序中使用加密库 我想问你有关苹果公司实施的加密货币出口政策的影响 我需要做一些额外的事情吗 例如填写表格等 1 如果我使用 MD5 进行哈希处理 2 如果我使用对称加密 Thanks EDIT 2009
  • 使用基于约束的布局自动调整 NSTokenField 的大小

    有没有办法自动调整大小height使用约束的 NSTokenField 保持宽度恒定 sizeToFit应该有效 但事实并非如此 如果我设置一个约束来保持宽度不变并调用此方法 它将忽略约束并仅调整宽度大小 当我想要的是仅调整高度大小时 基于

随机推荐

  • $locationChangeSuccess 触发四次

    我是 Angular Js 的新手 我的申请流程如下 1 我有一个视图控制器 其中每个视图控制器在面包屑工厂的帮助下设置面包屑数据 2 面包屑工厂从视图控制器获取数据并将数据附加到 location state 对象 存储在状态对象中的原因
  • 多个 AppDomain 和本机代码

    我的 C 应用程序使用的本机代码不是线程安全的 我可以运行该本机代码的多个进程 使用进程间通信来实现并发 我的问题是 我可以使用应用程序域来代替 以便多个托管线程 每个线程位于不同的应用程序域上 调用本机代码并且它们不会相互干扰吗 主要目标
  • 有没有办法让 Angular 项目中的 Bootstrap 和 Font Awesome 智能感知在 Visual Studio 2019 中作为文件夹打开

    我正在 Visual Studio 2019 中开发一个 Angular 项目 我已将其作为文件夹打开 一切都运转良好 适用于 TypeScript JavaScript 类和 Angular 的智能感知 当你滚动一个方法时 你会得到描述和
  • 让 Jenkins(Hudson)的工作依赖于另一份工作

    我有两份工作 Upload 启动实例 我要实现启动实例依赖于另一个 以便触发启动实例自动导致Upload首先运行 我可以使用内置 Jenkins 功能或插件来实现此目的吗 请注意 我这样做not want Upload始终触发启动实例 这就
  • 如何在 Typescript 项目中正确导入命名空间?

    我正在观看视频教程 并且创建了一个新的打字稿项目 首先 我在根目录中创建了以下命名空间 utilityFunctions ts namespace Utility export namespace Fees export function
  • Flask-RESTful:使用 GET 通过 REST 下载文件

    我正在尝试编写一个公开 REST 接口的文件共享应用程序 我正在使用的库 Flask RESTful 仅支持通过以下方式返回 JSONdefault http flask restful readthedocs org en latest
  • webgl readpixels 始终返回 0,0,0,0

    我正在尝试在 WebGl 中进行挑选 我渲染了两个形状 每个形状上映射了不同的纹理 我正在尝试抓取某些坐标上的像素 这是一个例子 var pixelValues new Uint8Array 4 gl readPixels 10 35 1
  • 尝试使用 C# 打开我的 Excel 文件并收到错误

    我尝试从代码中读取我的 Excel 文件并收到System InvalidCastException Additional information Unable to cast COM object of type System ComOb
  • 为什么Django中的404页面没有处理中间件?

    所以我在 URL 配置中设置了一个路径 path kitten views Kitten as view name kitten 以及同一视图中缺少 URL 的处理程序 handler404 views Kitten as view 我有一
  • 从 MyISAM 迁移到 InnoDB

    我对这个主题进行了一些搜索并找到了一些结果 然而 我正在寻找是否有人知道或可以向我指出一些真实或有信誉的案例研究 这些案例研究详细说明了从 MyISAM 迁移到 InnoDB 的好处 特别是性能 如果您能指出任何有关 MySQL 5 5 及
  • 管道“DatePipe”的参数“日期格式”无效?

    这似乎是一个简单的问题 我在 Ionic 2 应用程序中使用管道来获取日期格式 这是收到的 Web 服务响应 MessageID 544882 CategoryID 1 DateSent 2015 05 18T02 30 56 Title
  • 如何刷新 Bokeh 文档

    我想刷新散景文档 以便我可以用新的绘图替换旧的绘图 然而 现在我只是将新的绘图附加到文档中 这样旧的绘图就不会消失 myfile py from bokeh plotting import curdoc figure doc curdoc
  • shinyjqui::orderInput 中的最大项目

    如何限制数组中元素的数量orderInput小部件 来自包shinyjqui 例如 在下面的代码片段中 我想在第一个小部件中选择最多 2 个月 ui R library shiny library shinyjqui shinyUI flu
  • 如何让 android 服务保持phonegap ui 的活动

    我正在开发一个使用phonegap cordova 的Android 应用程序 该应用程序使用 JavaScript 不时从服务器获取内容 并在有新内容时发出系统托盘警报 我面临的问题是 当 Android 内存不足或其他任何情况时 应用程
  • 将对象数组转换为数组数组

    var json one text1 two text2 three 3 four 4 one text3 two text4 three 5 four 6 one text5 two text7 three 8 four 9 如何将上面的
  • Dokan 插件为单个订单的客户发送多封电子邮件

    我已经随我的 woocommerce 安装了 Dokan 多供应商插件 如果订单包含不同卖家的产品 它会为单个订单向客户发送多封电子邮件 订单邮件如下 邮寄所有购买的产品 订单中由一位卖家提供的产品 如何防止发送多封邮件 我只需要向客户发送
  • Karma + PhantomJS + 无法访问互联网

    我需要在无法访问互联网的持续集成服务器上使用 PhantomJS 运行 Karma 测试 每个构建都从运行开始npm install no registry进而gruntGrunt Karma 配置为单次运行 singleRun true
  • 当一个 SQL 表同时收到多个更新请求时会发生什么?

    我在 SQL Server 数据库中有一个表 其中记录了用户的最新活动时间 有人可以向我确认一下 当不同用户同时收到多个更新请求时 SQL Server 将自动处理这种情况吗 我预计该表上有 25 50 个并发更新请求 但每个请求负责更新表
  • 完成承诺而不拒绝/解决?

    我有一个等待用户输入的自定义确认对话框 我把它包裹在一个承诺中 当用户选择 是 时我resolve承诺 然而 当用户选择no这并不是真正的错误 而是不应该执行下一个任务 我应该如何处理带有承诺的情况 根本不调用解析 拒绝或者有更好的方法吗
  • iPhone 多点触控与 CorePlot 交互

    我正在开发一个带有核心图图表的 iPhone 应用程序 在一些教程的帮助下 我成功地通过单击和拖动来完成此操作 如何通过多次触摸和拖动来实现它 有人请帮帮我吗 视图控制器 m void viewDidLoad super viewDidLo