小编Jes*_*sus的帖子

如何重置<input type ="file">

我正在使用VS2012和Javascript开发一个metro应用程序

我想重置文件输入的内容:

<input type="file" id="uploadCaptureInputFile" class="win-content colors" accept="image/*" />
Run Code Online (Sandbox Code Playgroud)

我该怎么办?

javascript winjs visual-studio-2012

361
推荐指数
19
解决办法
43万
查看次数

NSWindowController上的viewWillAppear或viewDidAppear

我正在使用Xcode5.1在MacOS X上开发一个应用程序

并且每次用户打开时都会触发一个动作,或者显示我发现的NSWindowController

  • windowDidLoad
  • windowWillLoad
  • awakeFromNib

但在iOS中没有任何东西:我的方法......

  • viewWillAppear中
  • viewDidAppear

因为即使我关闭了NSWindowController

[NSWindowController关闭];

如果我再次打开它,它不会触发我的操作来自windowDidLoad,windowDidAppear或awakeFromNib

现在我需要类似他们的东西,等同于什么,它必须是某种东西

在此先感谢您的支持

macos cocoa xcode5

11
推荐指数
1
解决办法
4120
查看次数

使用Excel VBA按列值对工作表数据进行排序

我在vba中开发了下一个userform,它从工作表中获取信息以显示信息

在此输入图像描述

我想通过Segment以字母方式订购所有信息,这是代码:

Function llenarDatosTabla()

    Dim vList As Variant
    Dim ws As Worksheet: Set ws = Worksheets(BD_PRODXSIST)

    ListBox1.Clear

    With ws
        If (IsEmpty(.Range("AA2").Value) = False) Then

            Dim ultimoRenglon As Long: ultimoRenglon = devolverUltimoRenglonDeColumna("A1", BD_PRODXSIST)

            vList = ws.Range("AA2:AA" & ultimoRenglon & ":AL2").Value

            If IsArray(vList) Then
                Me.ListBox1.List = vList
            Else
                Me.ListBox1.AddItem (vList)
            End If

        End If

        Me.ListBox1.ListIndex = -1

    End With




    Set vList = Nothing
    Set ws = Nothing
End Function
Run Code Online (Sandbox Code Playgroud)

如何通过'AD'(SEGMENTO)专栏订购???

sorting excel vba worksheet-function excel-vba

8
推荐指数
2
解决办法
8万
查看次数

如何检测NSTextField何时具有焦点或者是否已选择cocoa的内容

我有一个的NSTextField的NSTableCellView里面,我想它告诉我的时候,我的NSTextField已经得到了禁用几个按钮的焦点事件,我发现这个方法:

-(void)controlTextDidBeginEditing:(NSNotification *)obj{
    NSTextField *textField  = (NSTextField *)[obj object];

    if (textField != _nombreDelPaqueteTextField) {
        [_nuevaCuentaActivoButton   setEnabled:FALSE];
        [_nuevaCuentaPasivoButton   setEnabled:FALSE];
        [_nuevaCuentaIngresosButton setEnabled:FALSE];
        [_nuevaCuentaEgresosButton  setEnabled:FALSE];
    }
}
Run Code Online (Sandbox Code Playgroud)

但它会在我的文本字段开始编辑时触发,因为这样说,我希望在我关注textField时禁用按钮,而不是在我已经开始键入时


编辑:要根据Joshua Nozzi收到的帮助我的代码,它仍然无法正常工作

MyNSTextField.h

#import <Cocoa/Cocoa.h>
@class MyNSTextField;

@protocol MyNSTextFieldDelegate

@optional -(BOOL)textFieldDidResignFirstResponder:(NSTextField *)sender;
@optional -(BOOL)textFieldDidBecomeFirstResponder:(NSTextField *)sender;

@end

@interface MyNSTextField : NSTextField

@property (strong, nonatomic)           id <MyNSTextFieldDelegate> cellView;

@end
Run Code Online (Sandbox Code Playgroud)

MyNSTextField.m

#import "MyNSTextField.h"

@implementation MyNSTextField

- (BOOL)becomeFirstResponder
{
    BOOL status = [super becomeFirstResponder];
    if (status)

        [self.cellView textFieldDidBecomeFirstResponder:self];
    return status;
}

- (BOOL)resignFirstResponder
{
    BOOL status = [super …
Run Code Online (Sandbox Code Playgroud)

macos cocoa focus nstextfield first-responder

7
推荐指数
2
解决办法
8647
查看次数

如何全屏开始NSWindow

我正在Xcode5中为Mac OSX开发一个应用程序

我希望全屏显示我的第一个窗口(我的视图中没有工具栏)

我找到了一种在角落显示全屏按钮的方法:

AppDelegate.m:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    screenFrame = [[NSScreen mainScreen] frame];

    [self.window setBackgroundColor: NSColor.whiteColor];
    [self.window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
    [[self window] setFrame:screenFrame display:YES];
}
Run Code Online (Sandbox Code Playgroud)

但要获得全屏我必须点击角落的按钮

在此输入图像描述

如何全屏保存按下该按钮的步骤?

macos fullscreen nswindow

5
推荐指数
2
解决办法
4199
查看次数

如何从 Cocoa 中的另一个 NSWindowController 打开一个 NSWindowController

我正在 Xcode5 中为 MacOSX 开发可可应用程序,我想通过按一个按钮从当前窗口打开另一个窗口,这是我的代码:

- (IBAction)openWindow:(id)sender {

    WindowController *controllerWindow = [[WindowController alloc] initWithWindowNibName:@"WindowController"];
    [controllerWindow showWindow:nil];
    [[controllerWindow window] makeMainWindow];
    }
Run Code Online (Sandbox Code Playgroud)

到目前为止,我可以看到窗口出现一秒钟,然后就消失了,如何正确执行此操作???

macos cocoa objective-c xcode5

3
推荐指数
1
解决办法
1034
查看次数

如何在NSComboBox上自动完成值

我正在Xcode5中为MacOS X开发一个应用程序

我想在用户输入或删除文本时在文本字段上键入自动填充选项,例如,如果用户键入"Me",那么墨西哥选项会显示在选项列表中,到目前为止这是我的代码:

@interface ComboNSObject()<NSComboBoxCellDataSource, NSComboBoxDataSource, NSComboBoxDelegate>{
    NSArray *datos;
}

@property (weak) IBOutlet NSComboBox *myCombo;

@end


@implementation ComboNSObject

-(void)awakeFromNib{
    datos = [[NSArray alloc]initWithObjects:@"Mexico",@"Guatemala",@"USA",@"Chile",@"Argentina", nil];

    [_myCombo addItemsWithObjectValues:datos];

}


- (NSString *)comboBox:(NSComboBox *)comboBox completedString:(NSString *)partialString
{
    for (NSString *dataString in datos) {
        NSLog(@"encontrado: %@", [dataString commonPrefixWithString:partialString options:NSCaseInsensitiveSearch]);
    }
    return @"";
}


@end
Run Code Online (Sandbox Code Playgroud)

我已经在我的NSObjectController上设置了_myCombo的委托和数据源以及它的NSComboBoxCell,但没有任何反应,显示我的自动完成的正确代码是什么

macos autocomplete nscombobox

3
推荐指数
1
解决办法
1724
查看次数

NSPopupButton在cocoa XCode5中更改其值时的通知

我想知道它是否是一种不同的方法

-(void)menu:(NSMenu *)menu willHighlightItem:(NSMenuItem *)item
Run Code Online (Sandbox Code Playgroud)

-(void)menuDidClose:(NSMenu *)menu
Run Code Online (Sandbox Code Playgroud)

帮助我知道NSPopupButton的选定值何时发生变化(例如,通过按键名而不是从NSMenu中选择它)

macos cocoa nspopupbutton xcode5.1

3
推荐指数
1
解决办法
4765
查看次数

如何在具有异步操作WinJS的for循环之后执行操作

我在WinJS上有这段代码:

// Triggers SOAP requests depending of how many webServices are required for uploading all the pictures
for (var i = 0; i < arrayCaptures.length; i++) 
{
    callWS(arrayTextFieldValues[i], UID_KEY[7], arrayCaptures[i].name).then(function (response) 
    {
        if (response == true) 
        {
            //if true, we have store the id of the picture to delete
            deletedCapturesIndexesArray.push(i);
        }
    },
    function (error) { }
    );
}

//my next action comes after this for loop
removeCapturesOfScreenWithIndexArray(deletedCapturesIndexesArray);
Run Code Online (Sandbox Code Playgroud)

它的作用:它使用异步操作(SOAP WebService调用)执行代码块,在第二个线程中执行removeCapturesOfScreenWithIndexArray,

我需要的是这个程序只有在for循环中的所有动作都完成后才执行我的下一个动作(removeCapturesOfScreenWithIndexArray),我认为它与promises主题有关,但是我没有这个,如何做到这一点? ??

javascript asynchronous winjs

2
推荐指数
1
解决办法
267
查看次数

任何与Mac OSX XCODE中的MDI Windows等效的东西

我刚刚开始为Mac OSX开发一个应用程序,我需要创建一个包含另一个子窗口的窗口,如下所示:

在此输入图像描述 在此输入图像描述

在VB.NET中称为MDI窗口(多文档接口),如果我没有错,在Java中称为JFrame,我需要它在可可中的等价物

在此先感谢您的支持

macos cocoa mdi jframe

1
推荐指数
1
解决办法
982
查看次数

如何以编程方式关闭NSPopover

我想知道如何以编程方式关闭NSPopover,而不是通过触摸外部,因为我想将其分配给一个动作(例如KeyDown Enter Key或其他快捷方式)

因为我用快捷方式打开我的NSPopover,按下另一个命令关闭更合乎逻辑

要分享我的代码:

EdiciondeCuentasWC.h(NSWindowController),我称之为NSPopover

#import "EdicionDeCuentasWC.h"
#import "CambiarTipoCuentaVC.h"
@interface EdicionDeCuentasWC ()<NSPopoverDelegate>{
    CambiarTipoCuentaVC         *cambiarTipoCuentaVC;
}
@property (strong) IBOutlet NSPopover *popoverClasifCuentas;

@end


@implementation EdicionDeCuentasWC

-(void)mostrarPopupCambiarTipoCta{

        cambiarTipoCuentaVC = (CambiarTipoCuentaVC *) _popoverCambiarTipoCuentas.contentViewController;
        cambiarTipoCuentaVC.nombre_tipo_cta  = arrayActivos[renglonSeleccionado][@"nombre_tipo_cta"];
        cambiarTipoCuentaVC.prioridad_cta    = arrayActivos[renglonSeleccionado][@"prioridad_cta"];

        NSTableCellView *cellView = [_activoTableView viewAtColumn:0
                                                               row:renglonSeleccionado
                                                   makeIfNecessary:NO];

        [_popoverClasifCuentas      setDelegate:self];
        [cambiarTipoCuentaVC        inicializarDatos];
        [_popoverCambiarTipoCuentas showRelativeToRect:[cellView bounds] ofView:cellView preferredEdge:NSMaxXEdge];
}

#pragma mark NSPopoverDelegate
-(void)popoverWillClose:(NSNotification *)notification{

    NSPopover *popover = (NSPopover *)[notification object]; //there I have the code for managing all the returning parameters...

}

@end
Run Code Online (Sandbox Code Playgroud)

我的NSPopover的代码是在一个NSViewController(CambiarTipoCuentaVC)里面,但在那里,我没有[自我关闭]或[self performClose]使它从一个按钮或快捷方式关闭,任何帮助使它工作,我很感激...

macos nspopover xcode5.1

0
推荐指数
2
解决办法
4424
查看次数