我想知道如何在 Mac 上运行两个版本的 xcode,或者是否可能。
我目前有许多使用 xcode7 版本提供服务的生产应用程序。我必须拥有它才能将应用程序版本上传到应用程序商店。
我还有一个 ipod touch 设备,正在运行 ios9.1 beta,并且想要为新操作系统测试和编写代码。
但是,xcode7 说我无法测试 ios 9.1 beta,我必须安装 xcode beta。另外,我了解到您无法使用测试版将应用程序推送到应用程序商店。那么如何维护当前的应用程序并构建新功能呢?
也许我错过了什么?一些设置允许我在这些 xcode 之间切换?或者Mac允许我安装两个不同版本的XCode吗?我以为它会覆盖另一个。
如果不需要的话,我不想购买另一台 Mac,或者对我拥有的 Mac 进行分区,或者继续在所有设备上下载并安装不同版本。
任何信息都会有帮助,其他人如何处理这个问题?
我正在制作一个非常简单的初学者项目,我从 textField 接收数据并将其存储在 Double var 中。我试过 .toDouble() 但它似乎不存在。请问有什么帮助吗?
我正在设计一个简单的数独应用程序,需要在点击 81 个按钮中的任何一个时触发一个动作。我在 ViewController 中创建了一个 UIButton 数组:
class SudokuBoardController : UIViewController {
@IBOutlet var collectionOfButtons: Array<UIButton>?
override func viewDidLoad() {
collectionOfButtons.addTarget(self, action: "buttonClicked:", forControlEvents: UIControlEvents.TouchUpInside)
...
}
}
Run Code Online (Sandbox Code Playgroud)
我可以从情节提要中将按钮添加到 Array 中,就在我尝试 addTarget 时,我收到以下消息:
Value of type 'Array<UIButton>?' has no member addTarget
Run Code Online (Sandbox Code Playgroud)
是否有解决此问题的方法不涉及我为每个按钮创建 81 个不同的输出?
谢谢你的帮助!
干杯
我编写了一个应用程序,当默认设置更改时,我需要重新加载所有设置。
但我没有头绪。我尝试重新启动或重新加载第一个视图控制器,但它不起作用。我的问题出在我从核心数据中获取并从中加载标签的所有视图控制器中,但我必须关闭应用程序并重新启动它才能看到更改。
知道如何做到这一点吗?
我制作了包含登录和注册功能的应用程序。当我当时运行我的应用程序时,登录和其他功能一切正常,但是当我停止我的应用程序并再次运行它时,登录页面再次显示我可以让用户在再次启动应用程序时登录。下面是我在我的应用程序中使用的代码。
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(true)
let prefs:NSUserDefaults = NSUserDefaults.standardUserDefaults()
let isLoggedIn:Int = prefs.integerForKey("ISLOGGEDIN") as Int
if (isLoggedIn != 1) {
self.performSegueWithIdentifier("goto_login", sender: self)
} else {
self.usernameLabel.text = prefs.valueForKey("USERNAME") as? String
}
}
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
/*
var rootViewController = self.window!.rootViewController
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main" , bundle: nil)
var isUserLoggedIn:Bool …Run Code Online (Sandbox Code Playgroud) 我一直试图从Apple安装Xcode 7 Beta 3几个小时,它不会在Yosemite 10.10.3上运行.我下载并运行安装程序,一切正常,但是当我尝试打开Xcode beta时,我得到一个持续30分钟的窗口,上面写着"正在验证",然后当它关闭时,我会得到一个窗口,上面写着Xcode beta是从互联网上下载,它想知道我是否还想打开它.我点击"打开",没有任何反应!根据任务经理的说法,Xcode beta没有响应.我试图重新验证它6次,甚至删除并重新安装Apple的xcode 7 beta.我将把El Capitan公测版放在我的外置硬盘上,看看xcode 7是否可以运行.虽然,无论如何我可以让Ycode 3 Beta 3在优胜美地10.10.3上运行吗?我有2009年中期的MacBook Pro,2.66GHz Intel Core 2 Duo,4 GB RAM,256GB SSD.
我目前正在使用Swift 2的Xcode 7 beta 4,尝试播放音频.我的代码中没有任何错误,但是当我按下播放按钮时,音频不会播放.我无法弄清楚出了什么问题.
import UIKit
import AVFoundation
class VesuviusViewController: UIViewController {
@IBOutlet weak var PausePlay: UIButton!
func playVes() {
do {
_ = try AVAudioPlayer(contentsOfURL: NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("Ves", ofType: "m4a")!))
} catch {
print("Error")
}
}
@IBAction func playButtonPressed(sender: AnyObject) {
playVes()
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
Run Code Online (Sandbox Code Playgroud)
更新 正确的代码:
import UIKit
import …Run Code Online (Sandbox Code Playgroud) 我刚刚将我的Xcode更新到7.0版(7A220),不幸的是,我遇到了一些问题.让我列出那些:
第二个是在运行时:
../ViewController.m:41:1: Conflicting return type in implementation of 'supportedInterfaceOrientations': 'UIInterfaceOrientationMask' (aka 'enum UIInterfaceOrientationMask') vs 'NSUInteger' (aka 'unsigned int')
Run Code Online (Sandbox Code Playgroud)
第三个也是在运行时:
(null): Directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks'
Run Code Online (Sandbox Code Playgroud)
有人能帮我吗 ?我正在使用Xcode 7.0(7A220)和SpriteKit来开发我的应用程序.
我想在上角用一个按钮制作一个tableview.我希望按钮再向表视图添加一行,以便您可以将图像添加到单元格或文本中.我在互联网上搜索但我没有找到答案.
这是源代码:
import UIKit
class TableViewController: UITableViewController {
var imageArray = ["1","2","3","4","5","6","7"]
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Reccept") as UITableViewCell!
let imageView = cell.viewWithTag(2) as! UIImageView!
imageView.image = UIImage(named: imageArray[indexPath.row])
return cell
}
override func tableView(tableView: UITableView, numberOfRowsInSection …Run Code Online (Sandbox Code Playgroud) 昨天我将MacBook Pro更新为El Capitan.我有Xcode 6.1更新Xcode不会打开,Xcode 6.1但我Xcode 7.0.1强行下载我不想升级,但我被迫.我用Objective-C创建了我的应用程序.提交给苹果,它目前正在"等待开发者发布".
我想改变一些东西,但现在无处不在,Xcode 7.0.1我得到了一个我从未收到过的错误Xcode 6.1.
ld: '/Users/markjak/Desktop/Stick Down copy/Leap Up/LibAdapterIAd- 1.0.0/libAdapterIAd.a(GADMAdapterIAdInterstitial.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
我如何做Xcode 7.0.1要我做的事情?
xcode7 ×10
ios ×7
xcode ×4
swift ×3
swift2 ×3
addtarget ×1
audio ×1
beta ×1
bitcode ×1
iphone ×1
osx-yosemite ×1
reloaddata ×1
restart ×1
sprite-kit ×1
uibutton ×1