标签: xcode4

Xcode 4 IDE 中的水平滚动

如何在 Xcode 4 的编辑器视图中启用水平滚动?该编辑器与 Xcode 3 的编辑器有很大不同,在 Xcode 3 中,如果代码超出行宽,编辑器将会出现水平滚动条。

与 Xcode 4 中一样,其余代码作为下一行出现,这让我很恼火!

谢谢,拉吉

xcode4

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

如何 NSTableView 单元格向单元格添加填充?

我有一个 NSTableView,它在我的窗口上从边缘延伸到边缘,但是表格边缘单元格中的数据确实需要一些填充。如果我在边缘留下排水沟,窗口看起来不太好,所以我想尝试在一些单元格内添加一些填充,这样数据就不会紧贴边缘。

我在 Interface Builder 或关于向单元格添加填充或插入的代码文档中找不到任何内容。

有什么建议?

macos xcode cocoa nstableview xcode4

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

使用Xcode在MacOS X上安装GMP

我正在尝试在我的C和C++程序中使用GMP库.我使用Xcode编写代码.我按照说明在我的机器上安装GMP,最后得到一个包含gmp.h文件的文件夹"〜/ usr/local/gmp-5.0.5".

如何让我的程序看到这个库?如果我决定将我的程序保存在桌面上,例如???

安装gmp-5.0.5的最佳位置在哪里?使用include"gmp.h"将显示错误"找不到文件".

c c++ macos gmp xcode4

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

-tableView:cellForRowAtIndexPath:没有被调用

我已经UITableView进入UIViewController并通过outlet和delegete连接,并且数据源被分配给自己.numberOfSectionsInTableView并且numberOfRowsInSection正在调用我尝试使用NSLog但是cellForRowAtIndexPath没有调用我的代码看起来像

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    NSLog(@" cellForRowAtIndexPath ");

    static NSString *CellIdentifier = @"CurrencyCell";

    CurrencyCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[CurrencyCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] ;
    }
    new *Obj = [appdelegate.array objectAtIndex:indexPath.row];


    cell.CurNameLabel.text = Obj.C_Name;
    cell.textLabel.text = @"sdfnhsdfndsio;";
    NSLog(@"C_Name %@", Obj.C_Name);

    return cell;
}
Run Code Online (Sandbox Code Playgroud)

任何一个电话我都会犯错误提前谢谢

iphone uitableview xcode4 ios5

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

如何处理点击过快的用户

我有一个简单的viewController.View控制器使用动画.如果我正在显示列表,它将动画显示.那时它也会改变指向地图的按钮而不是指向列表.

因此,通过持续按下相同的按钮(实际上它是2个不同的按钮,但用户将其视为相同的按钮),用户可以保持从一个地图到另一个列表的切换,反之亦然.

工作良好.随着一些捕获.

如果用户点击太快怎么办?让我们说,鉴于我希望确实使用我的应用程序,罐装或惩罚它们不是一种选择.

这是目前的计划:

-(void) transitiontoViewController:(UIViewController *)toViewController duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL))completion1
{


    [self enableButtonWithBool:false];
    UIViewController * fromController = self.last2ViewsInTheContainer.lastObject;
    if (fromController.view.superview!= self.ContainerView)
    {
        return;
    }
    [self transitionFromViewController:fromController toViewController:toViewController duration:duration options:options animations:animations completion:^(BOOL finished) {
        if (completion1 == Nil) //can't execute nil block. can be more elegantly done with [completion1 invoke] if there is such function. Anyway, do nothing if completion1 is nil
        {

        }
        else
        {
            completion1 (finished);
        }
        [self.last2ViewsInTheContainer addObject:toViewController];

        if (self.last2ViewsInTheContainer.count>2)
        {
            [self.last2ViewsInTheContainer removeObjectAtIndex:0];
        } …
Run Code Online (Sandbox Code Playgroud)

objective-c uiview uiviewanimationtransition xcode4

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

如何从KeyChain获取代理主机的用户名?

我正在Mac上编写一个实用程序,需要自动确定代理信息.我已经设法获取代理主机和端口(来自自动代理配置文件),但是如何从此获取钥匙串的用户名?

我知道您可以使用SecKeychainAddInternetPassword来获取代理密码,但我也不知道用户名.有没有办法获取用户名和密码?

macos objective-c keychain xcode4

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

如何在iPhone应用程序中实现PSCollectionView?

在我的应用程序中,我有六个按钮,需要放在pscollectionview上.我已经在应用程序中放置了pscollectionview但我不是在使用数据源和委托方法吗?任何人想出这个例子都会有帮助吗?以下是我的代码:

- (void)viewDidLoad
{

    self.collectionView = [[PSCollectionView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];


    self.collectionView.delegate = self;
    self.collectionView.collectionViewDelegate = self;
    self.collectionView.collectionViewDataSource = self;
    self.collectionView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    [self.view addSubview:self.collectionView];


    UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    btn1.frame = CGRectMake(10, 30, 140, 130);
    [self.collectionView addSubview:btn1];

    UIButton *btn2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    btn2.frame = CGRectMake(170, 30, 140, 130);
    [self.collectionView addSubview:btn2];

    UIButton *btn3 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    btn3.frame = CGRectMake(10, 180, 140, 130);
    [self.collectionView addSubview:btn3];

    UIButton *btn4 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    btn4.frame = CGRectMake(170, 180, 140, 130);
    [self.collectionView addSubview:btn4]; …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c ios xcode4 ios5

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

本地化后:无法在包路径中找到名为...的nib :( null)

我开始进入Mac OS X开发,我遇到的问题是我在过去三个小时内无法弄清楚的解决方案(我已经google了很长时间).

测试应用程序:
我有一个应用程序,它有一个MainMenu.xib显示窗口 - 到目前为止一直很好.我创建了另一个XIB和NSViewController子类,其中包含一个我想在主窗口中显示的视图.我使用以下代码加载视图并将其插入主窗口:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    // Insert code here to initialize your application
    self.compartmentViewController = [[SelectCompartmentViewController alloc] initWithNibName:@"SelectCompartmentViewController" bundle:nil];
    [self.compartmentViewController.view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
    [self.compartmentViewController.view setFrame:[self.contentArea bounds]];              
}
Run Code Online (Sandbox Code Playgroud)

compartmentViewController是一个属性,self.contentArea是主窗口上的自定义视图 - 就像一个占位符.

这到目前为止工作正常.

问题
然后我决定查看本地化功能.我已经本地化了几个字符串和两个XIB.起初,由于没有看到任何本地化的值,我有点困惑.直到我发现我必须清理项目 - 从那时起我在运行时遇到以下错误:

2013-03-19 22:48:59.763 Vocab Box [10160:303]无法找到命名的nib:捆绑路径中的SelectCompartmentViewController :( null)
2013-03-19 22:48:59.764 Vocab Box [10160:303] - [ NSViewController loadView]无法加载"SelectCompartmentViewController"笔尖.

建议的解决方案我试过无济于事

  1. 清理项目没有帮助
  2. 检查构建配置 - 是的,捆绑资源似乎没问题
  3. 是的,如果我删除了我的子视图的本地化并重新添加了原始的XIB,那么一切都很好(尽管当然视图没有本地化)

救命

macos localization xib xcode4

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

Xcode没有使用"标题搜索路径"来查找我的标题文件

我刚刚下载并编译了curl.在我的/ usr/include文件夹中,我可以看到文件夹'curl',我可以看到我确实有'/usr/include/curl/curl.h'.但是在编译时我不能说XCode在那里看.

#import <curl/curl.h>
Run Code Online (Sandbox Code Playgroud)

在我的目标属性中,我将'/ usr/include'包含在'标题搜索路径'中.构建继续失败,说它找不到'curl/curl.h'

我没有正确添加搜索路径吗?

谢谢

xcode curl objective-c libcurl xcode4

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

在 Xcode 中点击“全部替换”按钮的键?

我正在使用 Xcode 4.6.2 的文件内查找和替换功能。编程时,如果我能帮上忙,我不喜欢触摸鼠标,所以我会四处跳动以输入查找和替换文本。现在我想点击一个键或组合键来“启动”替换——实际上,点击“全部替换”按钮。这样的钥匙存在吗?

xcode replace keyboard-shortcuts xcode4

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