Tag: ios4

防止MFMailComposeViewController缩放animationGIF

我将一个animationGIF附加到一个电子邮件发送与MFMailComposeViewController。 如果GIF的大小足够大,MFMailComposeViewController会询问用户是否要将其调整为较小的大小。 不幸的是,animation将不会被保存在resize的图像。 我该如何禁止MFMailComposeViewController调整图像大小或使其保留animation?

如何重新加载UIViewController

我想重新加载包含在tabbar控制器(UIViewController)中的所有视图。search后,我发现我必须应用setNeedsDisplay方法,但我无法得到我应该在哪里应用它。还有其他的替代方法 – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ….. ….. self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; [self customToolbar]; [self.window addSubview:tabBarController.view]; [self.window makeKeyAndVisible]; return YES; } -(void)customToolbar { //Declared view controllers and their Navigation Controller ….. //Declared tab bar items ….. tabBarController = [[GTabBar alloc] initWithTabViewControllers:viewControllersArray tabItems:tabItemsArray initialTab:1]; }

iOS 4中有CC_MD5()和CC_SHA1()吗?

我期待在我的iOS应用程序中使用针对iOS 4及更高版本的MD5或SHA-1。 我使用CommonCrypto / CommonDigest.h中的CC_MD5()和CC_SHA1()函数。 它似乎在运行iOS 4.1和iPhone 4.0模拟器的iPhone上运行良好,但我担心,因为在XCode 4.2附带的iOS 5 SDK中声明如下函数: extern unsigned char *CC_MD5(const void *data, CC_LONG len, unsigned char *md) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_5_0); extern unsigned char *CC_SHA1(const void *data, CC_LONG len, unsigned char *md) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_5_0); 这似乎表明,这些function仅适用于iOS 5及更高版本。 这些function是否允许在iOS 4应用程序中使用,如果有的话,是否有任何正式的参考来certificate这一事实?

在UIAlertView中更改取消button的位置?

我注意到,当我从我的iPhone主屏幕上删除一个应用程序,出现的警报视图显示在左边的删除button和在右边的取消。 但是,当我使用UIAlertView在我的应用程序中构build一个删除function时,这些button似乎只显示左边的取消和右边的删除。 我想我的应用程序与操作系统一致,但我不知道如何使取消button首先出现。 有人知道吗? UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Delete Song" message:@"Are you sure you want to delete this song? This will permanently remove it from your database." delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Delete", nil]; 我尝试设置alert.cancelButtonIndex = 1,但是没有效果。

iPhone / iOS上常见的LISP

是否有可能在iOS中调用Common Lisp函数? 如果是这样,是否有可能在dynamic库中创build它?

是否可以将UITapGestureRecognizer附加到UILabel子类

我试图将手势识别器附加到我自己的UILabel的子类,但它不起作用。 你能帮我理解代码中的错误吗? @interface Card : UILabel { } – (void) addBackSideWord; @end #import "Card.h" @implementation Card – (id)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) { UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(addBackSideWord)]; [tapRecognizer setNumberOfTouchesRequired:2]; [tapRecognizer setDelegate:self]; [self addGestureRecognizer:tapRecognizer]; } return self; } – (void) addBackSideWord { //do something } @end

可以使用NSAttributedString将本机应用程序操作与单词连接起来吗?

我明白,NSAttributedString可用于检测超链接和设置样式等。 但是,我需要string的某些部分实际“链接”到应用程序中的特定操作。 例如,考虑文本 "this links should open up a native view for [photo 1] and " 我不希望照片1和video2连接到networking。 我想要一个新的photoviewcontroller堆叠在现有的导航堆栈之上。 这可以通过NSAttributedstring来实现吗? 如果没有,那么做一个简单的方法是什么? 如果可能的话,我不想使用单独的UI控件,因此在定位方面会非常混乱。

代码示例创build自己的键盘

我search了四处创造我的自定义键盘样品,但似乎没有任何帮助。 所以请给我一个代码示例来创build我的自定义键盘 请帮助我

在后台播放AVAudioPlayer的一个实例

我的应用程序中有几个AVAudioPlayer实例(在单独的类中)。 我为一个实例添加了多任务function,但现在所有audio都在后台播放。 我添加了“应用程序播放audio”键给我的plist和: [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; [[AVAudioSession sharedInstance] setActive: YES error: nil]; 我的class级。 我怎样才能将这个代码只定位到AVAudioPlayer的一个实例?

获取MFMailComposeViewController中的Recepients列表

我在我的应用程序中使用MFMailcomposerViewController。 一切工作正常,除了我需要有没有。 的收件人和用户发送给收件人的列表。 任何关于这个问题的帮助或解决scheme