使用iOS 6的新SLComposeViewController功能发布到Facebook,Twitter或新浪微博需要遵循哪些步骤?
我可以通过UIAppearance代理设置哪些属性?Apple的UIKit文档没有列出它们.有这些属性的列表吗?
我想UICollectionViewController在iOS 6下实现pull-down-to-refresh .这很容易实现UITableViewController,如下所示:
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(startRefresh:)
forControlEvents:UIControlEventValueChanged];
self.refreshControl = refreshControl;
Run Code Online (Sandbox Code Playgroud)
以上实现了一个漂亮的液滴动画作为本机小部件的一部分.
由于UICollectionViewController"更加进化",UITableViewController人们会期待某种功能的奇偶性,但我无法在任何地方找到参考来实现这一点的内置方式.
UIRefreshControl用某种方式使用UICollectionViewController,尽管报头和文档都指出它的意思与表视图中使用?我正在尝试将属性字符串设置为iOS 6中的UITextView.问题是,如果我尝试在属性字符串上设置font属性,则会忽略行间距.但是,如果我没有设置字体,并使用默认字体,则行间距有效.
NSString *string = @" Hello \n world";
attrString = [[NSMutableAttributedString alloc] initWithString:string];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy];
paragraphStyle.minimumLineHeight = 50;
// setting the font below makes line spacing become ignored
[attrString addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:20] range:NSMakeRange(0, string.length)];
[attrString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, string.length)];
mainTextView.attributedText = attrString;
Run Code Online (Sandbox Code Playgroud)
知道发生了什么事吗?
Apple正在更改其iOS6的隐私设置并弃用设备UUID(UDID).根据WWDC演示文稿和文档,UDID有两个替代品,在UIDevice课堂上:
-identifierForVendor-identifierForAdvertising在我看来,-identifierForVendor它不如-identifierForAdvertising因为它会在上次从供应商卸载应用程序时重置并"擦除所有内容和设置".
没有什么优势-identifierForVendor有过-identifierForAdvertising?
根据Apple的文档(并在WWDC 2012上吹捧),可以UICollectionView动态设置布局,甚至可以为更改设置动画:
通常在创建集合视图时指定布局对象,但也可以动态更改集合视图的布局.布局对象存储在collectionViewLayout属性中.设置此属性会立即直接更新布局,而无需为更改设置动画.如果要为更改设置动画,则必须调用setCollectionViewLayout:animated:方法.
然而,在实践中,我发现它UICollectionView会contentOffset导致莫名其妙的甚至无效的更改,导致单元格移动不正确,使得该功能几乎无法使用.为了说明这个问题,我将以下示例代码放在一起,这些代码可以附加到放入故事板的默认集合视图控制器中:
#import <UIKit/UIKit.h>
@interface MyCollectionViewController : UICollectionViewController
@end
@implementation MyCollectionViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"CELL"];
self.collectionView.collectionViewLayout = [[UICollectionViewFlowLayout alloc] init];
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return 1;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
UICollectionViewCell *cell = [self.collectionView dequeueReusableCellWithReuseIdentifier:@"CELL" forIndexPath:indexPath];
cell.backgroundColor = [UIColor whiteColor];
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"contentOffset=(%f, %f)", self.collectionView.contentOffset.x, self.collectionView.contentOffset.y);
[self.collectionView setCollectionViewLayout:[[UICollectionViewFlowLayout alloc] init] animated:YES];
NSLog(@"contentOffset=(%f, %f)", self.collectionView.contentOffset.x, …Run Code Online (Sandbox Code Playgroud) 我试图减少目前48MB的iOS应用程序的整体大小.当我分析子文件夹时,我发现Assets.car占用了41MB.我无法打开并看到哪一个占用了那么多空间.
我找不到有关Assets.car文件的任何好文档.有人可以建议如何查看内容吗?


我已经关闭了Autolayout,并且viewcontroller嵌入在导航控制器中.我正在使用Xcode 5,Storyboard.
我不明白为什么它会从顶部留下空间.实际上在故事板中我把我的标签正好放在导航栏下方.但是当我在模拟器上运行它然后它从顶部离开空间.
解决这个问题的一种黑客方法
-(void)viewWillLayoutSubviews
{
self.scrollViewMain.frame = CGRectMake(0, -70, 320, 800);
self.scrollViewMain.contentSize = CGSizeMake(320, 800);
}
Run Code Online (Sandbox Code Playgroud)
但我错过了一些非常简单的方法.
自从我将Xcode更新到4.5版并开始为iOS 6构建这样的日志消息后不断出现:
ADDRESPONSE - ADDING TO MEMORY ONLY
Run Code Online (Sandbox Code Playgroud)
我从来没有要求过(至少没有意识到).
我需要做些什么来阻止这些消息?它们的起源是什么?
我想改变导航栏颜色的颜色,但我不确定是否应该改变色调或背景.我知道iOS 7将采用更平面的设计(甚至建议删除渐变),但我无法破译这两个.即使我设置了背景颜色,也没有做任何事情.
在此图像中,背景设置为绿色,但条形仍为蓝色:
