Tag: cocoa touch

在UIAlertView的自动dimissal之后,导航栏的色彩更改

我写了我的自定义UIAlertview允许在某些情况下自动解雇。 现在,在iOS 7的自动解雇发生我的导航栏的色彩变化。 根据iOS7转换指南: https://developer.apple.com/library/ios/documentation/userexperience/conceptual/transitionguide/TransitionGuide.pdf 当出现警告或操作表时,iOS 7会自动调暗其后的视图的色调。 为了响应这种颜色变化,在其渲染中使用tintColor的自定义视图子类应该覆盖tintColorDidChange以适当刷新渲染。 任何想法,如果这只能在自定义的UIAlertView中处理。 以下是我自定义UIAlertView的代码: #define kStartupFailAlert 203 #import "RunnerUIAlertView.h" @implementation RunnerUIAlertView – (id)init { self = [super init]; if (self) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(removeAlert) name:kRemoveVisibleAlert object:nil]; } return self; } – (void)removeAlert { if (self.tag != kStartupFailAlert) { // If not kRunnerStartupFailAlert – as it will be auto […]

如何在应用程序更新下载后再次调用didFinishLaunchingWithOptions

我想知道如何在应用程序更新下载后再次调用didFinishLaunchingWithOptions,因为我所有的函数都在那里。 我需要再次调用self.dataArray = [self readDataJsonFromDocument]; 再次,我从网上下载数据。 – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [self UIAppearances]; //first load [self copyJsonFromBundle]; [self copyFolderFromBundle]; self.dataArray = [self readDataJsonFromDocument]; //i need to call this again // Override point for customization after application launch. // Add the tab bar controller's current view as a subview of the window self.window.rootViewController = self.tabBarController; […]

dismissModalViewControllerAnimated在iOS6上崩溃

我正面临iOS 6.0的崩溃。 我有一个视图控制器,我从中呈现一个导航视图控制器模态,然后从导航堆栈我呈现另一个视图控制器模态,最后解散整个模态堆栈我将以下消息传递到我的第一个视图控制器从我显示导航控制器。 现在这个工作正常在iOS 6.0以下。 我应该如何处理? [self dismissModalViewControllerAnimated:YES];

更改iAd的位置和位置

我一直在看各种教程和代码片段,尝试实施iAd。 我已经成功了一定程度,但我需要定制,我似乎无法解决我需要做什么来做出我的更改,任何人都可以帮忙吗? – (void)viewDidLoad { adView = [[ADBannerView alloc] initWithFrame:CGRectZero]; adView.frame = CGRectOffset(adView.frame, 0, -50); adView.requiredContentSizeIdentifiers = [NSSet setWithObjects:ADBannerContentSizeIdentifierPortrait, ADBannerContentSizeIdentifierLandscape, nil]; adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait; [self.view addSubview:adView]; adView.delegate = self; self.bannerIsVisible = NO; [super viewDidLoad]; // Do any additional setup after loading the view from its nib. } – (void)bannerViewDidLoadAd:(ADBannerView *)banner { if (!self.bannerIsVisible) { [UIView […]

如何popToRoot在一个标签上,当用户在不同的标签?

我有一个iPhone应用程序,有四个选项卡。 在选项卡1上有一个UINavigationController。 用户可以在堆栈视图上深入三层。 比方说,用户转到导航标签页1的级别2,然后切换到标签页3.有什么办法可以制作一个button,用户可以按然后popToRoot导航控制器在选项卡1(幕后),而他们仍然在表3? 这样,当触摸Tab 1再次他们将在根? 我不希望它在根级别每次触摸Tab 1时,只有当他们触摸Tab 3上的button时,它才会将Tab 1popup到根级别。

实际使用variables时未使用的variables警告

我在Xcode中给出了一个警告,我正在使用的variables没有被使用: – (void)timerTicked:(id)sender { [timerButton setTitle:[self timerIsActive] ? @"Stop timer" : @"Start Timer" forState:UIControlStateNormal]; if([self timerIsActive]) { NSTimeInterval interval = [[NSDate date] timeIntervalSinceDate:timeEntry.startDate]; double seconds = (int) interval % 60; double minutes = (int) interval / 60.0; double hours = (int) interval / 60.0 / 60.0; [timerLabel setText:[NSString stringWithFormat:@"%.0f hours %.0f minutes %.0f seconds", hours, […]

在由步进器控制的单元格中设置一个标签 – 目标c

您好我有一个UITableView,我dymanically插入单元格,其中包含UIStepper和UILabel。 UILabel显示UIStepper的值。 – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; if(!cell) cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; [cell.textLabel setText:[self.myarray objectAtIndex:indexPath.row]]; UIStepper *stepper = [[UIStepper alloc]init]; UILabel *label = [[UILabel alloc]init]; label.text = [NSString stringWithFormat:@"%.f", stepper.value]; [cell addSubview:stepper]; [cell addSubview:label]; [stepper addTarget:self action:@selector(incrementStepper:) forControlEvents:UIControlEventValueChanged]; return cell; } 我已经删除了一些上面的行格式为了clarities而行,但这个工程,一切都很好。 -(void)incrementSkillStepper:(id)sender { UIStepper *stepper = […]

UIScrollView中的UISwipeGestureRecogniser

UISwrollGestureRecognizer可以在UIScrollView中工作吗? 我有一些向上或向下滑动的UIImageViews,但是这一切都需要在UIScrollView中,因为内容大于窗口大小。 所以当我试图刷UIImageView整个屏幕滚动。

如何复制一个NSMutableAttributedString

我只是想知道如何做一个NSMutableAttributedString的副本。 我有一个名为text的属性,我想将它的内容保存在某个点,并在发生某些事情时恢复它。 我试着做一个名为textCopy属性,我可以保存到@property (nonatomic, copy)但我得到一个运行时错误,当我这样做: -[NSConcreteAttributedString insertAttributedString:atIndex:]: unrecognized selector sent to instance. 我将如何做到这一点? 运行时错误更新。 我得到这个随时将NSMutableAttributedString设置为@property (nonatomic, copy) 。 不明白为什么这不起作用,一般来说复制参数似乎无法与NSMutableAttributedString一起使用,无论是否使用其setter方法。

如何将构build发送到已configuration的远程人员的iPhone

我们为iPhone开发configuration了3个设备。 2个开发人员和一个经理电话。 当经理曾经在这里,我们曾经把他的手机连接到我们的Mac,并与他分享的build设。 他现在正在远程工作。 我现在怎么把这个build筑物给他呢? 他的设备已经configuration好了,他现在正在运行旧版本的应用程序(正在开发中)。 我们需要用新版本更新他的手机。 我们正在使用XCode4.2和Lion。 请帮忙。