Parse saveInBackgroundWithBlock crashes on iOS

524 Views Asked by At

I am adding some data into my parse class (table) successfully.

After saving is successfully completed (I can see the data on website), my app crashes without leaving any message on console. I tried to get a message by using "Enable Zombie Objects" setting. This is the message I am getting which has nothing to do what I am doing:

-[UIActivityIndicatorView release]: message sent to deallocated instance 0x126d16780

I do not have any UIActivityIndicatorView in my whole project.

This is how I save my data:

var currentUser = PFUser.currentUser()!

        var userCase = PFObject(className: "Case")
        userCase.relationForKey("user").addObject(currentUser)
        userCase["caseCode"] = "test_code"
        userCase.saveInBackgroundWithBlock {
            (success: Bool, error: NSError?) -> Void in
            if (success) {
                // The object has been saved.
                println("saved")
            } else {
                // There was a problem, check error.description
                println("error occurred: \(error?.description)")
            }
        }

Swift SDK version: 1.7.5 Xcode version: 6.4

Has anybody have ever faced with such problem?

UPDATE: This error does not occur on simulator (tested on iPhone 5, iPhone 5S, iPhone 6) and does not occur on device at first run.

Tried removing and re-installing the app.

UPDATE 2: Removing PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions) or changing it to PFFacebookUtils.initialize() from AppDelegate fixes the issue but I think I need to use initializeFacebookWithApplicationLaunchOptions(launchOptions). I have another problem now.

1

There are 1 best solutions below

0
Orhun Mert Simsek On

You may do the following.

1) Go to PFFacebookUtils.h

2) change:

(void)initializeFacebookWithApplicationLaunchOptions:(NSDictionary *)launchOptions;
To:

(void)initializeFacebookWithApplicationLaunchOptions:(PF_NULLABLE NSDictionary *)launchOptions;

It was originally posted here