goal c – Parse iOS XCode: Class names can’t begin with an underscore

0
20
goal c – Parse iOS XCode: Class names can’t begin with an underscore


I get this error at initialization of Parse.
Probably it’s as a result of I up to date to XCode Model 16.0 (16A242d). MacOS is 14.5 (23F79).

I’ve put in Parse as a pod. Additionally tried to take away it and set up newest model as a Bundle Dependency however similar error.

[Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id configuration) {
            configuration.applicationId = @"myAppId";
            configuration.clientKey = nil;
            configuration.server = @"myParseServerUrlStringHostedonHeroku";
}]];

Here’s what I get after I run the app: (No errors whereas compiling.)

*** Terminating app on account of uncaught exception 'NSInvalidArgumentException', purpose: Invalid class title. Class names can't begin with an underscore.'
*** First throw name stack:
(
    0   CoreFoundation                      0x00000001804ae0f8 __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x0000000180087db4 objc_exception_throw + 56
    2   CoreFoundation                      0x00000001804ae008 -[NSException initWithCoder:] + 0
    3   myApp.debug.dylib   0x0000000106d2f1f8 +[PFObject(Private) _assertValidInstanceClassName:] + 180
    4   myApp.debug.dylib   0x0000000106d37598 -[PFObject init] + 436
    5   myApp.debug.dylib   0x0000000106d37898 -[PFObject initWithObjectState:] + 92
    6   myApp.debug.dylib   0x0000000106d379cc +[PFObject objectWithClassName:objectId:completeData:] + 248
    7   myApp.debug.dylib   0x0000000106d37ae0 +[PFObject objectWithClassName:] + 80
    8   myApp.debug.dylib   0x0000000106d37fcc +[PFObject object] + 252
    9   myApp.debug.dylib   0x0000000106cf6bdc __56-[PFCurrentInstallationController getCurrentObjectAsync]_block_invoke.9 + 452
    10  myApp.debug.dylib   0x0000000106a64f18 __62-[BFTask continueWithExecutor:successBlock:cancellationToken:]_block_invoke + 124
    11  myApp.debug.dylib   0x0000000106a64848 __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke + 88
    12  myApp.debug.dylib   0x0000000106a615c0 __29+[BFExecutor defaultExecutor]_block_invoke_2 + 152
    13  myApp.debug.dylib   0x0000000106a61da0 -[BFExecutor execute:] + 88
    14  myApp.debug.dylib   0x0000000106a64b24 __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke.15 + 44
    15  myApp.debug.dylib   0x0000000106a642f4 -[BFTask runContinuations] + 508
    16  myApp.debug.dylib   0x0000000106a63cd8 -[BFTask trySetResult:] + 208
    17  myApp.debug.dylib   0x0000000106a65a50 -[BFTaskCompletionSource trySetResult:] + 88
    18  myApp.debug.dylib   0x0000000106ce88fc __28-[PFAsyncTaskQueue enqueue:]_block_invoke_2 + 216
    19  myApp.debug.dylib   0x0000000106a64848 __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke + 88
    20  libdispatch.dylib                   0x00000001022cbec4 _dispatch_call_block_and_release + 24
    21  libdispatch.dylib                   0x00000001022cd73c _dispatch_client_callout + 16
    22  libdispatch.dylib                   0x00000001022d05a0 _dispatch_queue_override_invoke + 1320
    23  libdispatch.dylib                   0x00000001022e136c _dispatch_root_queue_drain + 372
    24  libdispatch.dylib                   0x00000001022e1f18 _dispatch_worker_thread2 + 256
    25  libsystem_pthread.dylib             0x00000001022277d8 _pthread_wqthread + 224
    26  libsystem_pthread.dylib             0x00000001022265d4 start_wqthread + 8

After debugging, this was inflicting the difficulty:
In PFObject:

+ (instancetype)object {
    PFConsistencyAssert([self conformsToProtocol:@protocol(PFSubclassing)],
                        @"Can solely name +object on subclasses conforming to PFSubclassing");
    NSString *className = [(id)self parseClassName];
    Class class = [[self subclassingController] subclassForParseClassName:className] ?: [PFObject class];
    return [class objectWithClassName:className];
}

NSString *className = [(id)self parseClassName]; on this line className comes out to be “_Installation” as a result of in PFInstallation there may be:

+ (NSString *)parseClassName {
    return @"_Installation";
}

Additionally, [[self subclassingController] subclassForParseClassName:className] return nil.

Spent virtually total day on this with out breaks and pissed off. All I’ve a doubt on is that the subclasses will not be registering in Parse->Core->PFObjectSubclassingController:

- (void)registerSubclass:(Class)kls {
    pf_sync_with_throw(_registeredSubclassesAccessQueue, ^{
        [self _rawRegisterSubclass:kls];
    });
}

which provides a zero at [[self subclassingController] subclassForParseClassName:className].

Please assist! Desperately in want. Thanks!

LEAVE A REPLY

Please enter your comment!
Please enter your name here