我有一个.xib文件,我希望它是一个表视图控制器,但是当我在.xib文件中创建一个表视图控制器时,我得到了错误Table views with embedded sections and cells are only supported in storyboard documents.我该如何解决.下面是我的实际表视图的代码.
self.add = [Play(name: title!), Play(name: artist!), Play(name: album!)]
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.add.count
//return count of objects in array
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = self.tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! UITableViewCell
var play: Play
play = add[indexPath.row]
cell.textLabel?.text = play.name
return cell
}
Run Code Online (Sandbox Code Playgroud) 为什么它给我错误2015-09-14 20:56:31.773 Musec[7207:3288153] FBSDKLog: starting with Graph API v2.4, GET requests for /me should contain an explicit "fields" parameter我试图访问用户信息,如朋友,电子邮件等.如何修复错误?以下是登录以及访问用户信息的权限.
@IBAction func loginWithFB(sender: AnyObject) {
var permissions = [ "public_profile", "email", "user_friends"]
PFFacebookUtils.logInInBackgroundWithReadPermissions(permissions, block: { (user: PFUser?, error: NSError?) -> Void in
if let user = user {
if user.isNew {
println("User signed up and logged in through Facebook!")
self.performSegueWithIdentifier("success", sender: self)
//let params = ["fields": "name, email, friends"]
let graphRequest: FBSDKGraphRequest = FBSDKGraphRequest(graphPath: "me", parameters: ["fields": "name, email, …Run Code Online (Sandbox Code Playgroud) 播放播放按钮时,我正播放30秒的歌曲.当播放歌曲时,我想要一个进度条来绕过播放按钮.我该怎么做?
play = add[indexPath.row]
let playButton : UIButton = UIButton.buttonWithType(UIButtonType.Custom) as! UIButton
playButton.tag = indexPath.row
let imageret = "playbutton"
playButton.setImage(UIImage(named: imageret), forState: .Normal)
playButton.frame = CGRectMake(236, 20, 100, 100)
playButton.addTarget(self,action: "playit:", forControlEvents: UIControlEvents.TouchUpInside)
Run Code Online (Sandbox Code Playgroud)