小编jos*_*ney的帖子

如何计算文件夹的大小?

我正在创建一个文件夹,用我的iPhone App缓存Documents中的图像.我希望能够将此文件夹的大小保持在1MB,因此我需要检查文件夹的大小(以字节为单位).

我有代码来计算文件大小,但我需要文件夹的大小.

最好的方法是什么?

iphone nsfilemanager ios

66
推荐指数
5
解决办法
4万
查看次数

iPhone UISearchBar和keyboardAppearance

当键盘出现时,我想设置

keyboardAppearance = UIKeyboardAppearanceAlert
Run Code Online (Sandbox Code Playgroud)

我检查了文档,看起来你只能更改keyboardType.

这可以在不违反任何Apple私有API的情况下完成吗?

iphone uisearchbar iphone-sdk-3.0

9
推荐指数
4
解决办法
7207
查看次数

NSInvalidArgumentException

我在这里撕扯我的头发.已经阅读了许多描述如何解决这个问题的例子,但没有一个帮助我摆脱这个问题.

在UIView上有一个简单的按钮链接到IBAction.

代码就是这个......

Contact.h

#import <UIKit/UIKit.h>

@interface Contact : UIViewController {
}

-(IBAction)buttonPressed:(id)sender;

@end
Run Code Online (Sandbox Code Playgroud)

Contact.m

#import "Contact.h"

@implementation Contact

- (IBAction)buttonPressed:(id)sender  
{
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Button Pressed" message:@"You pressed the button" delegate:nil cancelButtonTitle:@"Yep, I did." otherButtonTitles:nil];
    [alert show];
    [alert release];
}
Run Code Online (Sandbox Code Playgroud)

不断收到此错误消息:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIViewController buttonPressed:]: unrecognized selector sent to instance 0xd1d5f0'
Run Code Online (Sandbox Code Playgroud)

Touch Up Inside使用buttonPressed链接到文件的所有者.

已下载其他示例代码,它们工作正常.我的项目和笔尖的设置与其他示例代码完全相同.

还没有找到哪里开始尝试调试它的线索.

有人帮吗?

iphone cocoa-touch

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

/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2失败,退出代码为1

可能重复:
gcc-4.2失败,退出代码为1 iphone

知道为什么我收到此错误消息吗?

/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2失败,退出代码为1

我试图将MGTwitterEngine和yajl集成到我的项目中,所以按照这里的说明进行操作......

http://damienh.org/2009/06/20/setting-up-mgtwitterengine-with-yajl-106-for-iphone-development/

管理得到它来编译但它停止了该错误.现在已经删除了我添加到项目中的所有框架引用,并删除了所有MGTwitterEngine类,基本上将它恢复到原来的状态.每当我编译,我仍然最终得到这个......

/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2失败,退出代码为1

如果我打开其他项目,他们工作得很好......

很奇怪,有什么想法吗?

iphone

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