小编Ran*_*rns的帖子

Mac应用程序的设计视图

有没有办法为Mac App Store创建应用程序的方式与iPhone/iPad应用程序商店的方式相同?使用Interface Builder或类似程序创建将使用IBOutlets和IBActions连接到代码的视图?

如果没有,任何人都可以概述创建Mac应用程序而不是iOS应用程序所需的内容,并且可能指向一个好的教程,示例源代码或文档资源?

谢谢你的帮助!

macos xcode interface-builder app-store

2
推荐指数
1
解决办法
864
查看次数

armv7不包含在构建中

我的目标和项目构建设置都被设置为arm64 armv7 armv7s作为有效架构。

  • 架构:标准架构(armv7,arm64)-$
  • 有效架构:arm64 armv7 armv7s

当我存档并上传构建时,iTunes Connect将其分类为仅arm64。在“支持的体系结构”下,iTunes Connect仅显示arm64。这样一来,我的应用就无法用于旧设备(iPhone 5,iPad 2,iPad Mini 1等)

有人遇到过吗?我在Xcode设置中支持armv7,但是该归档中未包含该支持。

xcode itunesconnect armv7 ios arm64

2
推荐指数
2
解决办法
3437
查看次数

SwiftUI - 禁用某些视图从右到左语言翻转

当我们的应用程序以从右到左的语言(例如希伯来语或阿拉伯语)运行时,SwiftUI 视图会自动将视图的位置从右到左翻转。其中一些观点非常有帮助,但某些观点不应该被推翻。

我们在视图上尝试了.flipsForRightToLeftLayoutDirection(false) ,但这并没有阻止它们在使用设置为希伯来语或阿拉伯语的方案运行时以不同的方式定位。

将不胜感激任何帮助。谢谢你!

localization arabic right-to-left ios swiftui

2
推荐指数
1
解决办法
959
查看次数

有没有办法在已经注释的部分上使用块注释?

我知道你可以注释掉一整段代码,如下所示:

/*
line of code
line of code
line of code
*/
Run Code Online (Sandbox Code Playgroud)

但是如果你在试图评论的代码中已经有一个/*...*/部分,则注释块的*/end将关闭我试图创建的"更大"注释块.

例:

/* wanting to comment this big section out
line of code
line of code
line of code
line of code
line of code
line of code
/* this section was already commented out before
line of code
line of code
line of code
*/ this section was already commented out before
line of code
line of code
line of code
line of code
line of code …
Run Code Online (Sandbox Code Playgroud)

xcode comments objective-c

1
推荐指数
1
解决办法
5210
查看次数

从NSMutableArray中提取特定数据的速度更快?

我有一个充满了我创建的名为"问题"的NSObjects的数组.每个问题的一个属性是它属于哪个级别.如果用户选择了玩2级,我想获得所有具有.level属性为2的问题.现在我正在循环查看所有问题以找到匹配项,但这需要~2秒才能在iPad上运行3 /新iPad设备.有没有更快的方法来处理这样的情况?

int goThrough = 0;    
do {
      Question *currentQuestion = [allQs objectAtIndex:(goThrough)];

      if (currentQuestion.level == levelChosen) {
             [questions addObject:currentQuestion];
      }
      goThrough++;
    } while (goThrough < [allQs count]);
Run Code Online (Sandbox Code Playgroud)

非常感谢您的帮助!

arrays sorting objective-c ios

1
推荐指数
1
解决办法
106
查看次数

[self viewDidAppear:YES];

是否[self viewDidAppear:YES];在码viewDidLoad中部分确保代码的viewDidAppear部分将运行?

基于我们用户的一小部分反馈,无论出于何种原因,我在主菜单视图的viewDidAppear部分中编写的代码都没有为它们运行 - 但它对大多数用户和所有用户都非常有效.我的测试.我希望通过添加[self viewDidAppear:YES]; 这将解决那些由于某种原因没有调用viewDidAppear的设备的问题...

你们有什么感想?

iphone viewdidload viewdidappear ipad

0
推荐指数
1
解决办法
158
查看次数

NSLayoutConstraint和safeAreaLayoutGuide-兼容iOS 11之前的代码

如果我想要一个与iOS 11之前的设备兼容的应用程序,是否需要每个将视图的某些属性链接到self.view的约束的代码,以便遵守safeAreaLayoutGuide?

if #available(iOS 11.0, *) {
     NSLayoutConstraint.activate([
          theImage.heightAnchor.constraint(equalTo: view.safeAreaLayoutGuide.heightAnchor, multiplier: 0.5)
          theImage.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -20),
          theImage.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -view.frame.width/8)
     ])
} else {
     NSLayoutConstraint.activate([
          theImage.heightAnchor.constraint(equalTo: view.heightAnchor, multiplier: 0.5)
          theImage.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -20),
          theImage.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -view.frame.width/8),
     ])
}
Run Code Online (Sandbox Code Playgroud)

nslayoutconstraint swift ios10 ios11 safearealayoutguide

0
推荐指数
1
解决办法
235
查看次数