10

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.

JustWork
  • 1,944
  • 3
  • 22
  • 34
  • Where is the line that crashes? Are you sure it's related to your saveInBackgroundWithBlock? – Van Du Tran Jul 13 '15 at 21:48
  • There is no line that it crashes. Xcode focuses AppDelegate.swift file on crash. It just crashes whenever I use Parse API. If I remove Parse codes, no crush occurs. – JustWork Jul 13 '15 at 21:51
  • 1
    The first danger you have in your code is the first line: var currentUser = PFUser.currentUser()! Replace that with "if var currentUser = PFUser.currentUser() { // code }. PFUser.currentUser() can return a "nil", and you're forcing it to unwrap then you proceed to add a nil currentUser to your "user" relation, – Van Du Tran Jul 13 '15 at 21:55
  • It is just an example to see if saving works. I am totally sure currentUser is not null in this case. – JustWork Jul 13 '15 at 21:56
  • Ok, if you say so. Can you println the "error" even if it's success, to see if there is actually an error? Usually, you can't pretend that because success is true that error is nil, but in this case it seems acceptable. – Van Du Tran Jul 13 '15 at 21:57
  • Yeah, error is nil. I just printed. – JustWork Jul 13 '15 at 22:00
  • what is the problem you are having – Lamour Jul 23 '15 at 01:06
  • whenever I use PFFacebookUtils with Facebook SDK together my app is crashing. – JustWork Jul 23 '15 at 01:07
  • Try setting up an exception breakpoint to see where it really crashes. (Select Objective-C under Exceptions, even for Swift) https://developer.apple.com/library/ios/recipes/xcode_help-breakpoint_navigator/articles/adding_an_exception_breakpoint.html – Bojan Dimovski Aug 03 '15 at 13:22
  • A full stack trace would help too – ivanmoskalev Aug 24 '15 at 15:19
  • @BojanDimovski no difference. I still get the "*** -[UIActivityIndicatorView release]: message sent to deallocated instance 0x154d0c8e0" error. – JustWork Sep 15 '15 at 23:55

1 Answers1

0

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

Community
  • 1
  • 1