Xcode error in building the code from asset compatible IOS

Hello,

i have some trouble with Xcode (first time on it :s)

i was thinking export to unity and build immediately with Xcode to test it on iPhone was easy but no … (for android it’s so easy)

i have one variable who can’t be initialized by itself , and when i initialize it before used it it doesn’t work too

the variable in cause is AVPlayerStatus on line 7

here the void :

- (void)observeValueForKeyPath:(NSString*)path ofObject:(id)object change:(NSDictionary*)change context:(void*)context
{
    BOOL reportPlayerReady = NO;

    if(context == _ObserveItemStatusContext)
    {
        AVPlayerStatus status = [[change objectForKey:NSKeyValueChangeNewKey] integerValue];
        switch(status)
        {
            case AVPlayerStatusUnknown:
            break;

            case AVPlayerStatusReadyToPlay:
            {
                NSArray* video = [_playerItem.asset tracksWithMediaType:AVMediaTypeVideo];
                if([video count])
                    _videoSize = [(AVAssetTrack*)[video objectAtIndex:0] naturalSize];

                if([AVPlayerItem instancesRespondToSelector:@selector(duration)])
                   _duration = [_playerItem duration];
                else
                    _duration = [[[[[_playerItem tracks] objectAtIndex:0] assetTrack] asset] duration];

                _assetReady = YES;
                reportPlayerReady = _itemReady;
            }
            break;

            case AVPlayerStatusFailed:
            {
                AVPlayerItem *playerItem = (AVPlayerItem*)object;
                [self reportError:playerItem.error category:"prepareAsset"];
            }
            break;
        }
    }
    elseif(context == _ObservePlayerItemContext)
    {
        if( [change objectForKey:NSKeyValueChangeNewKey] != (id)[NSNull null] )
        {
            _itemReady = YES;
            reportPlayerReady = _assetReady;
        }
    }
    else
    {
        [superobserveValueForKeyPath:path ofObject:object change:change context:context];
    }

    if(reportPlayerReady)
    {
        _playerReady = YES;
        [delegateonPlayerReady];
    }
}

the code is from a asset (easy movie texture compatible Android/IOS)

thanks by advance.

Maybe just a cast like:
AVPlayerStatus status = (AVPlayerStatus) [[change objectForKey:NSKeyValueChangeNewKey] integerValue];
will help in this chase. It did with my project.

That code syntax looks so alien to me

It’s Objectiv-C - Unity generates it for XCode.

i love you so much. it was so simple but looks like image28 said “so alien” haha xD thanks!!!