Parse SDK methods not working in Xcode 6.3 Beta

前端 未结 5 1798
夕颜
夕颜 2021-01-12 13:39

So far I am having issues with blocks like this:

user.signUpInBackgroundWithBlock {
        (succeeded: Bool!, error: NSError!) -> Void in
        if erro         


        
5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-12 14:13

    Notation of Swift is changed

    class AAPLList : NSObject, NSCoding, NSCopying { 
        // ...
        func itemWithName(name: String!) -> AAPLListItem!
        func indexOfItem(item: AAPLListItem!) -> Int
    
        @NSCopying var name: String! { get set }
        @NSCopying var allItems: [AnyObject]! { get }
        // ...
    }
    

    After annotations:

    class AAPLList : NSObject, NSCoding, NSCopying { 
        // ...
        func itemWithName(name: String) -> AAPLListItem?
        func indexOfItem(item: AAPLListItem) -> Int
    
        @NSCopying var name: String? { get set }
        @NSCopying var allItems: [AnyObject] { get }
        // ...
    }
    

    So you can change

    (succeeded: Bool!, error: NSError!) -> Void in

    to

    (success: Bool, error: NSError?) -> Void in

提交回复
热议问题