Skip to content

Commit e2411d7

Browse files
committed
Mark PFInstallation.+currentInstallation as nullable.
1 parent 47214e7 commit e2411d7

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Parse/PFInstallation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFInstallation : PFObject<PFSu
4747
If this installation is not stored on disk this method will create a new `PFInstallation`
4848
with `deviceType` and `installationId` fields set to those of the current installation.
4949
50-
@result Returns a `PFInstallation` that represents the currently-running installation.
50+
@result Returns a `PFInstallation` that represents the currently-running installation if it could be loaded from disk, otherwise - `nil`.
5151
*/
52-
+ (instancetype)currentInstallation;
52+
+ (nullable instancetype)currentInstallation;
5353

5454
/**
5555
*Asynchronously* loads the currently-running installation from disk and returns an instance of it.

ParseStarterProject/OSX/ParseOSXStarterProject-Swift/ParseOSXStarterProject/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
4747

4848
func application(application: NSApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
4949
let installation = PFInstallation.currentInstallation()
50-
installation.setDeviceTokenFromData(deviceToken)
51-
installation.saveInBackground()
50+
installation?.setDeviceTokenFromData(deviceToken)
51+
installation?.saveInBackground()
5252

5353
PFPush.subscribeToChannelInBackground("") { (succeeded: Bool, error: NSError?) in
5454
if succeeded {

ParseStarterProject/iOS/ParseStarterProject-Swift/ParseStarterProject/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
7676

7777
func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
7878
let installation = PFInstallation.currentInstallation()
79-
installation.setDeviceTokenFromData(deviceToken)
80-
installation.saveInBackground()
79+
installation?.setDeviceTokenFromData(deviceToken)
80+
installation?.saveInBackground()
8181

8282
PFPush.subscribeToChannelInBackground("") { (succeeded: Bool, error: NSError?) in
8383
if succeeded {

ParseStarterProject/watchOS/ParseStarterProject-Swift/ParseStarterProject/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
8181

8282
func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
8383
let installation = PFInstallation.currentInstallation()
84-
installation.setDeviceTokenFromData(deviceToken)
85-
installation.saveInBackground()
84+
installation?.setDeviceTokenFromData(deviceToken)
85+
installation?.saveInBackground()
8686

8787
PFPush.subscribeToChannelInBackground("") { (succeeded: Bool, error: NSError?) in
8888
if succeeded {

0 commit comments

Comments
 (0)