如何在 Xcode 4 的编辑器视图中启用水平滚动?该编辑器与 Xcode 3 的编辑器有很大不同,在 Xcode 3 中,如果代码超出行宽,编辑器将会出现水平滚动条。
与 Xcode 4 中一样,其余代码作为下一行出现,这让我很恼火!
谢谢,拉吉
我有一个 NSTableView,它在我的窗口上从边缘延伸到边缘,但是表格边缘单元格中的数据确实需要一些填充。如果我在边缘留下排水沟,窗口看起来不太好,所以我想尝试在一些单元格内添加一些填充,这样数据就不会紧贴边缘。
我在 Interface Builder 或关于向单元格添加填充或插入的代码文档中找不到任何内容。
有什么建议?
我正在尝试在我的C和C++程序中使用GMP库.我使用Xcode编写代码.我按照说明在我的机器上安装GMP,最后得到一个包含gmp.h文件的文件夹"〜/ usr/local/gmp-5.0.5".
如何让我的程序看到这个库?如果我决定将我的程序保存在桌面上,例如???
安装gmp-5.0.5的最佳位置在哪里?使用include"gmp.h"将显示错误"找不到文件".
我已经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)
任何一个电话我都会犯错误提前谢谢
我有一个简单的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) 我正在Mac上编写一个实用程序,需要自动确定代理信息.我已经设法获取代理主机和端口(来自自动代理配置文件),但是如何从此获取钥匙串的用户名?
我知道您可以使用SecKeychainAddInternetPassword来获取代理密码,但我也不知道用户名.有没有办法获取用户名和密码?
在我的应用程序中,我有六个按钮,需要放在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) 我开始进入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"笔尖.
建议的解决方案我试过无济于事
救命
我刚刚下载并编译了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 4.6.2 的文件内查找和替换功能。编程时,如果我能帮上忙,我不喜欢触摸鼠标,所以我会四处跳动以输入查找和替换文本。现在我想点击一个键或组合键来“启动”替换——实际上,点击“全部替换”按钮。这样的钥匙存在吗?
xcode4 ×10
macos ×4
objective-c ×4
xcode ×3
ios5 ×2
iphone ×2
c ×1
c++ ×1
cocoa ×1
curl ×1
gmp ×1
ios ×1
keychain ×1
libcurl ×1
localization ×1
nstableview ×1
replace ×1
uitableview ×1
uiview ×1
xib ×1