应用程序加载程序停留在“使用iTunes Store进行身份validation”阶段

我正要上传一个应用程序到iTunes连接,但应用程序加载程序一直处于“使用iTunes Store进行身份validation”的阶段,并等待了将近一个小时。networking没问题,我从来没有见过这种情况。遇到任何人这种问题? 有什么解决办法?提前致谢。

QR码扫描在iOS应用程序

我需要将QR码阅读器集成到应用程序中,并find了一个教程 。 我从这个链接下载了Z-bar sdk。 这是我所做的。 在QRscannerViewController.m中 -(IBAction)StartScan:(id) sender { ZBarReaderViewController *reader = [ZBarReaderViewController new]; reader.readerDelegate = self; reader.readerView.torchMode = 0; ZBarImageScanner *scanner = reader.scanner; // TODO: (optional) additional reader configuration here // EXAMPLE: disable rarely used I2/5 to improve performance [scanner setSymbology: ZBAR_I25 config: ZBAR_CFG_ENABLE to: 0]; // present and release the controller [self presentModalViewController: […]

对于IBOutlet和其他

我已经将我的项目切换到了ARC,而且我不明白我是否必须使用IBOutlet strong或weak 。 Xcode做到这一点:在界面生成器中,如果创build一个UILabel例如,我将其与助理编辑器连接到我的ViewController ,它创build此: @property (nonatomic, strong) UILabel *aLabel; 它使用strong ,而是我阅读RayWenderlich网站上的一个教程,说: 但是对于这两个特定的属性我有其他的计划。 我们将宣布它们变weak ,而不是strong 。 @property (nonatomic, weak) IBOutlet UITableView *tableView; @property (nonatomic, weak) IBOutlet UISearchBar *searchBar; 所有出口物业的推荐关系都Weak 。 这些视图对象已经是视图控制器视图层次结构的一部分,不需要保留在其他地方。 声明您的网点weak的一大优点是可以节省您编写viewDidUnload方法的时间。 目前我们的viewDidUnload如下所示: – (void)viewDidUnload { [super viewDidUnload]; self.tableView = nil; self.searchBar = nil; soundEffect = nil; } 现在可以将其简化为以下内容: – (void)viewDidUnload { [super viewDidUnload]; soundEffect […]

iOS推送通知:如何检测当应用程序在后台时用户是否轻敲通知?

有很多关于这个主题的stackoverflow线程,但我仍然没有find一个好的解决scheme。 如果应用程序不在后台,我可以在application:didFinishLaunchingWithOptions:检查launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey] application:didFinishLaunchingWithOptions:调用以查看是否从通知打开。 如果应用程序在后台,所有postbuild议使用application:didReceiveRemoteNotification:并检查应用程序状态。 但是,正如我试验(也作为这个API的名称build议),这个方法被调用时收到的通知,而不是轻拍。 所以问题是,如果应用程序启动,然后后台,你知道从application:didReceiveNotification接收通知application:didReceiveNotification ( application:didFinishLaunchWithOptions:不会触发),你怎么知道用户是否恢复从应用程序点击通知或只是点击应用程序图标? 因为如果用户点击通知,则期望打开通知中提到的页面。 否则它不应该。 我可以使用handleActionWithIdentifier进行自定义动作通知,但是只有当自定义动作button被触发时才触发,而不是在用户点击通知主体时触发。 谢谢。 编辑: 在阅读下面的一个答案后,我想这样可以澄清我的问题: 我们如何区分这两种情况: (A)1.app进入后台; 收到通知 3.用户点击通知; 4.应用程序进入前台 (B)1.app进入背景; 收到通知 3.用户稍后忽略通知并点击应用程序图标; 4.应用程序进入前台 由于application:didReceiveRemoteNotification:在步骤2中都触发了这两种情况。 或者, application:didReceiveRemoteNotification:仅在步骤3中触发(A),但我以某种方式configuration了我的应用程序错误,所以我在步骤2看到它?

我如何使用Core Graphics绘制箭头?

我需要画我的绘制应用程序结束箭头线。 我不擅长三angular,所以不能解决这个问题。 用户将他的手指放在屏幕上并向任何方向画线。 所以,箭头应该出现在行结束。

在使用UITableViewAutomaticDimension更新UITableViewCell之后进行粗糙的滚动

我正在构build一个具有用户提交的post的提要视图的应用程序。 这个视图有一个自定义UITableViewCell实现的UITableViewCell 。 在这个单元UITableView ,我有另外一个显示注释的UITableView 。 要点是这样的: Feed TableView PostCell Comments (TableView) CommentCell PostCell Comments (TableView) CommentCell CommentCell CommentCell CommentCell CommentCell 最初的Feed将下载3个评论用于预览,但是如果有更多评论,或者如果用户添加或删除评论,我想通过添加或删除CommentCells到评论PostCell来更新PostCell中的PostCell 。 PostCell里面的表。 我目前正在使用下面的帮手来完成这个工作: // (PostCell.swift) Handle showing/hiding comments func animateAddOrDeleteComments(startRow: Int, endRow: Int, operation: CellOperation) { let table = self.superview?.superview as UITableView // "table" is outer feed table // self is the PostCell […]

在iOS中最有效的方法来绘制图像的一部分

给定一个UIImage和一个CGRect ,什么是最有效的方式(在内存和时间)来绘制图像的CGRect对应的CGRect (无缩放)? 作为参考,这是我目前如何做到这一点: – (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGRect frameRect = CGRectMake(frameOrigin.x + rect.origin.x, frameOrigin.y + rect.origin.y, rect.size.width, rect.size.height); CGImageRef imageRef = CGImageCreateWithImageInRect(image_.CGImage, frameRect); CGContextTranslateCTM(context, 0, rect.size.height); CGContextScaleCTM(context, 1.0, -1.0); CGContextDrawImage(context, rect, imageRef); CGImageRelease(imageRef); } 不幸的是,这对于中等尺寸的图像和高的setNeedsDisplay频率似乎非常慢。 使用UIImageView的框架和clipToBounds产生更好的结果(具有较小的灵活性)。

iOS:使用UIView的“drawRect:”与其图层的delagate“drawLayer:inContext:”

我有一个类是UIView的子类。 我可以通过实现drawRect方法或通过实现drawLayer:inContext:这是CALayer的委托方法来在视图内绘制东西。 我有两个问题: 如何决定使用哪种方法? 每个人都有一个用例吗? 如果我实现drawLayer:inContext:它被调用(并且drawRect不是,至less就放一个断点可以告诉),即使我没有分配我的视图作为CALayer委托通过使用: [[self layer] setDelegate:self]; 如果我的实例没有被定义为图层的委托,那么如何调用委托方法呢? 如果drawLayer:inContext:被调用,什么机制可以防止drawRect被调用?

在后台运行iPhone作为iBeacon

是否可以将iOS 7设备作为蓝牙LE外设(iBeacon)运行并在后台投放广告? 我已经能够在下面的代码在前台广告,可以从另一个iOS设备看到它,但只要我回到主屏幕停止广告。 我在plist中添加了蓝牙外设的后台模式,但似乎没有帮助,虽然我得到提示说设备要在后台使用蓝牙。 我做错了什么,或者这只是不可能在iOS 7? peripManager = [[CBPeripheralManager alloc] initWithDelegate:self queue:nil]; – (void)peripheralManagerDidUpdateState:(CBPeripheralManager *)peripheral { if (peripheral.state != CBPeripheralManagerStatePoweredOn) { return; } NSString *identifier = @"MyBeacon"; //Construct the region CLBeaconRegion *beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:identifier]; //Passing nil will use the device default power NSDictionary *payload = [beaconRegion peripheralDataWithMeasuredPower:nil]; //Start advertising [peripManager startAdvertising:payload]; } […]

源文件中的Swift Editor占位符

嗨有问题的Swift编辑器占位符在源文件“这是我的代码 public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell{ let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: <#T##IndexPath#>) as! CustomBrandCell let brandImage: UIImage = UIImage(named: self.brands[indexPath.row].name)! cell.brandImageView.image = brandImage return cell }