小编Obj*_*ift的帖子

Swift:不能使用NSImage .imageNamed

我看到imageNamed从可用选项中被弃用(或删除)当我执行以下操作时:

       var statusImage:NSImage? = nil

       self.statusImage = NSImage .ImageNamed....
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

我已经尝试过苹果公司和其他公司提供的Swift文档.这看起来非常简单但无法找到imageNamed的解决方案.我错过了什么吗?

swift osx-yosemite

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

cURL - 结构化验证服务器发送事件的请求

我是cURL和服务器发送事件的新手.我知道如何使用cURL构建一个简单的GET,POST请求并获得响应.另外,从理论上讲,我知道服务器发送事件是通过创建事件源的监听器来处理的,但我不知道如何继续使用cURL验证任何此类API.任何指导表示赞赏.

curl server-sent-events

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

XCode - CallStack图标

callstack符号表示什么?我对如何分析callstack有点了解,但我从未理解这些符号的用途.

xcode callstack objective-c ios

6
推荐指数
0
解决办法
197
查看次数

iOS - 托管JSON文件以使用URL解析它

我有一个包含有效数据的.json文件.我想在线托管并在我的应用中使用实时网址.我尝试将json文件放在drop box中并尝试验证http://jsonformatter.curiousconcept.com网站上的json数据,但它显示"JSON数据URL不包含JSON数据"有没有其他方法可以实现此目的?谢谢.

rest json web-hosting ios

6
推荐指数
3
解决办法
1万
查看次数

Xcode - 在XCode 5上使用多个SDK

我有一个需要iOS 6.1 SDK的项目,我已升级到XCode5,并且在Build Settings - > Base SDKs中没有看到iOS 6.1 SDK.我已经将早期的SDK单独保存并尝试将其复制粘贴到/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs目录中.但它没有出现在Build settings - > Base SDKS中.如何在Xcode 5中使用多个SDK?

ios xcode5

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

' - '的右操作数是垃圾值

我第一次使用静态分析仪,很难弄清楚箭头.在看了一些关于SO的类似问题后,我认为问题是CGSize大小是零值,但我不完全确定它是如何工作的.

这是代码:

 - (void)keyboardDidShow:(NSNotification*)notification {
    CGSize size = CGSizeMake(0, 0);
    size = [self keyboardSize:notification];
      if (UIInterfaceOrientationIsLandscape(self.interfaceOrientation)) {
            detailTableView.frame = CGRectMake(detailTableView.frame.origin.x, detailTableView.frame.origin.y,
                                       detailTableView.frame.size.width, kTableViewMovableHeight + kTableViewDefaultHeight -  size.height
                                       );
    //detailTableView.scrollEnabled = YES;
    }
}


- (CGSize)keyboardSize:(NSNotification *)aNotification {
NSDictionary *info = [aNotification userInfo];
NSValue *beginValue = [info objectForKey:UIKeyboardFrameEndUserInfoKey];
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
CGSize keyboardSize;
UIDeviceOrientation _screenOrientation = orientation;
if ([UIKeyboardDidShowNotification isEqualToString:[aNotification name]]) {
    if (UIDeviceOrientationIsPortrait(orientation)) {
        keyboardSize = [beginValue CGRectValue].size;
    } else {
        keyboardSize.height = [beginValue CGRectValue].size.width;
        keyboardSize.width = …
Run Code Online (Sandbox Code Playgroud)

cocoa-touch objective-c clang-static-analyzer ios

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

OSX:使用Tab键在文本字段和按钮之间移动键盘焦点

我正在尝试使用键盘的选项卡按钮在视图中的文本字段和按钮之间切换.文本字段之间的切换有效,但不会在按钮之间切换.视图如下所示.我没有在网上找到足够的资源继续进行.有谁知道如何解决这个问题?

在此输入图像描述

macos cocoa objective-c

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

重新加载子视图(UICollectionview)

在我的ViewController中,我有四个子视图,即UITableView,UICollectionView,View with UILabels和View,显示该项目的预览图像.

通过在tableview中选择一行,我可以更改预览图像和所有标签.但是我无法刷新UICollectionView数据.我尝试了这个解决方案,但它只是删除并添加了视图,并且更改了布局和预览图像消失了.

我想要做的就是刷新UICollectionView内容.有没有更简单的方法来做到这一点?

objective-c ios uicollectionview

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

Swift - 添加UITableView协议

我正在关注Apple文档(页面链接)以在空的ViewController.swift文件中添加tableview.添加协议时如下所示:

Class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
// define the class
 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.
  }
}

func tableView(tableView: UITableView!, numberOfRowsInSection section:    Int) -> Int {
return 10
}

func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) ->        UITableViewCell! {
let cell: UITableViewCell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: "MyTestCell")

cell.text = "Row …
Run Code Online (Sandbox Code Playgroud)

swift ios8

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