在ios中设置back barbutton项的标题

我在我的应用程序中使用故事板,如果我设置ViewController类的title属性,那么当我推入一个SecondViewController时,该string将显示为我的后退button的文本,我该如何改变这一点?,我想把一个不同的后退button的标题。 我已经使用这个,但它不工作: UIBarButtonItem *btnBack = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:self action:nil]; [self.navigationItem setBackBarButtonItem: btnBack]; 请帮帮我

具有自动布局和节重装的UITableViewHeaderFooterView子类不能很好地协同工作

我试图将自动布局合并到我的UITableViewHeaderFooterView子类。 这个class很基本,只有两个标签。 这是完整的子类: @implementation MBTableDetailStyleFooterView static void MBTableDetailStyleFooterViewCommonSetup(MBTableDetailStyleFooterView *_self) { UILabel *rightLabel = [[UILabel alloc] init]; _self.rightLabel = rightLabel; rightLabel.translatesAutoresizingMaskIntoConstraints = NO; [_self.contentView addSubview:rightLabel]; UILabel *leftLabel = [[UILabel alloc] init]; _self.leftLabel = leftLabel; leftLabel.translatesAutoresizingMaskIntoConstraints = NO; [_self.contentView addSubview:leftLabel]; NSDictionary *views = NSDictionaryOfVariableBindings(rightLabel, leftLabel); NSArray *horizontalConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"|-10-[leftLabel]-(>=10)-[rightLabel]-10-|" options:0 metrics:nil views:views]; [_self.contentView addConstraints:horizontalConstraints]; // center […]

UILabel切断自定义字体。 如何根据select的自定义字体dynamic调整UILabel高度?

在UILabel中显示的一些自定义字体已经加载到我的应用程序中。 我有多个自定义字体,我需要正确显示。 我怎样才能解决这个问题?

iPhone – 跟踪手机数据使用情况

有没有一种方法来跟踪iPhone上的手机数据使用情况? 有很多像“Dataman”和“DataUsage”一样的应用程序, 基本上我正在寻找一种编程方式来获取信息存储在设置 – >常规 – >使用 任何帮助将不胜感激。

在UIDocumentInteractionController中定制“电子邮件”操作

有什么办法可以将自定义操作添加到UIDocumentInteractionController提供的操作列表中吗? 我想添加一个“电子邮件”行动的名单。 我知道我可以使用MFMailComposeViewController发送附件的电子邮件,但问题不是如何发送文件作为附件的问题是UI之一。 我有一个“行动”UIBarButtonItem,它带来了UIDocumentInteractionController提供打印和打开在iBooks的选项。 太好了…但是我还需要一个单独的UIBarButtonItem来发送附加到电子邮件的文件。 用户看到这样的内容有点令人困惑: 这不仅让用户感到困惑,而且还不是一个理想的用户界面。 最好在UIDocumentInteractionController列表中有“Email”作为选项之一。 有什么build议么? 肯尼

iOS – animation标签或图像的animation

我怎样才能使标签或图像的运动变成animation? 我只想从屏幕上的一个位置缓慢转换到另一个位置(没有什么奇特的)。

在UICollectionView中以编程方式select项目

我有一个UICollectionViewController : – (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return [self.pageTastes count]; } – (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { CellTasteCollectionView *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" forIndexPath:indexPath]; Taste *taste = [self.pageTastes objectAtIndex:indexPath.item]; [[cell imageView] setImage:taste.image]; [cell setObjectId:taste.objectId]; return cell; } 有用。 我有这个viewDidLoad ,允许用户select多个项目: [self.collectionView setAllowsMultipleSelection:YES]; 我想要的是,第一次加载CollectionView,一些项目被选中编程,基于它们在CellTasteCollectionView objectId 。 以下是我如何做到这一点: – (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ Taste *taste = [self.pageTastes […]

编译错误尝试使用CAGradientLayer

我试图使用CAGradientLayer并获得无益的编译错误。 无法弄清楚什么是错的。 我到目前为止所做的是: CAGradientLayer *gradient = [CAGradientLayer layer]; 我已经导入了<QuartzCore/QuartzCore.h> ,我得到了警告> _OBJC_CLASS_ $ CAGradientLayer引用自:objc-class-ref-to-CAGradientLayer符号(s)not found。 我试过干净,但没有运气,我似乎无法在Xcode中的目标以外的任何其他4.1 欢呼任何帮助。

为什么我的对象的弱委托属性在我的unit testing中为零?

我为这个unit testing有一个非常简单的设置。 我有一个具有委托属性的类: @interface MyClass : NSObject … @property (nonatomic, weak) id<MyDelegateProtocol> connectionDelegate; … @end 我在testing中设置了委托: – (void)testMyMethod_WithDelegate { id delegate = mockDelegateHelper(); // uses OCMock to create a mock object [[delegate expect] someMethod]; myClassIvar.connectionDelegate = delegate; [myClass someOtherMethod]; STAssertNoThrow([delegate verify], @"should have called someMethod on delegate."); } 但是这个委托实际上并没有设置在我的unit testing的第3行,所以#someMethod永远不会被调用。 当我改变它 myClassIvar.connectionDelegate = delegate; STAssertNotNil(myClassIvar.connectionDelegate, […]

Xcode 5铛:错误:链接器命令失败,退出代码1(使用-v看到调用)

我为我的移动应用程序项目使用xcode 5。 我尝试构build项目时出现此错误。 ld: warning: directory not found for option '-L\\\\\\\"/Applications/MAMP/htdocs/rmbp/apps/rmbp/iphone/native/WorklightSDK\\\\\\\"' ld: warning: directory not found for option '-L/Applications/MAMP/htdocs/rmbp/apps/rmbp/iphone/native/WikitudeSDK' ld: warning: directory not found for option '-F"/Applications/MAMP/htdocs/rmbp/apps/rmbp/iphone/native/Frameworks"' ld: warning: directory not found for option '-F/Applications/MAMP/htdocs/rmbp/apps/rmbp/iphone/native/WikitudeSDK' ld: framework not found sqlcipher clang: error: linker command failed with exit code 1 (use -v to see invocation) ld: […]