//
// main.m
// Journey
//
// Created by Julian Buscema on 2014-07-13.
// Copyright (c) 2014 Julian Buscema. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[])
{
#autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
When I try running my application, my main.m opens up and the "return UIApplicationMain...." line is highlighted in green saying thread 1: signal SIGABRT. I googled it and it says that it has to do with my AppDelegate.h file but which part of it?
Here it is:
//
// AppDelegate.h
// Journey
//
// Created by Julian Buscema on 2014-07-13.
// Copyright (c) 2014 Julian Buscema. All rights reserved.
//
#import <UIKit/UIKit.h>
#interface AppDelegate : UIResponder <UIApplicationDelegate>
#property (strong, nonatomic) UIWindow *window;
#end
Your error says this class is not key value coding-compliant for the key username.
Something is not right with element named username. Did you create outlets from Storyboard to your ViewController? If you you did, are you renamed property in ViewController?
Try right clicking on UITextField and check outlets. Empty white circle means your outlet is broken, it must be white.
Related
I created a Objective C framework which i want to use in Swift Project. I want to expose only one header file in the framework.Following is my header file
//
// VideoPlayer.h
// DRMFrameworkObjc
//
// Created by Next on 01/08/17.
// Copyright © 2017 Next. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Streaming.h"
#import "LicenseManager.h"
#import <widevine_cdm_sdk_insecure_dev_sim/DashToHlsApiAVFramework.h>
#import <AVKit/AVKit.h>
#import <AVFoundation/AVFoundation.h>
#interface VideoPlayer : NSObject<StreamingDelegate>
#property(nonatomic) Streaming* streaming;
#property(nonatomic) AVPlayer* player;
#property(nonatomic) AVURLAsset* asset;
#property(nonatomic) NSArray* assetKeysRequiredToPlay;
#property(nonatomic) AVPlayerItem* playerItem;
-(void)initWithURl:(NSURL*)url playerInstance:(AVPlayer*)player controllerInstance:(UIViewController*) controller;
-(void)setupStreaming:(NSURL*)url controllerInstance:(UIViewController*) controller;
-(void)streamingReady:(NSNotification*)notification;
#end
So i added this header in the Umbrella header as below:
//
// DRMFrameworkObjc.h
// DRMFrameworkObjc
//
// Created by Next on 01/08/17.
// Copyright © 2017 Next. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for DRMFrameworkObjc.
FOUNDATION_EXPORT double DRMFrameworkObjcVersionNumber;
//! Project version string for DRMFrameworkObjc.
FOUNDATION_EXPORT const unsigned char DRMFrameworkObjcVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <DRMFrameworkObjc/PublicHeader.h>
#import <DRMFrameworkObjc/VideoPlayer.h>
When i add this framework to Swift project I was getting "Could not build Objective C framework ..." and other error is "Streaming.h file not found..". I added the VideoPlayer.h file in bridging header. Why am i getting Streaming.h not found when i don't want it to expose? Is my method of creating Objective C framework wrong? Where am i wrong?
I created a project a few week ago and opened it today. When i left the project there were no errors and everything worked fine, but now i have three errors and don't know why.
Here my AppDelegate.h :
#import <UIKit/UIKit.h>
#interface AppDelegate : UIResponder <UIApplicationDelegate>
#property (strong, nonatomic) UIWindow *window;
#end
And here my main.m:
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[])
{
#autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
Here the errors:
/main.m: Semantic Issue Use of undeclared identifier 'AppDelegate'
AppDelegate.h: Parse Issue Expected identifier or '('
AppDelegate.h: Parse Issue '#end' must appear in an Objective-C context
I have recently made some significant changes to a Corona Enterprise app I am writing for iOS. The code was using a .xib file to launch the AppDelegate, and I have removed that and I am loading a different AppDelegate in my main.mm
The following is my main.mm
//
// main.mm
// Examples
//
#import <UIKit/UIKit.h>
#import "CoronaApplicationMain.h"
#import "MyAppDelegate.h"
int main(int argc, char *argv[])
{
#autoreleasepool
{
CoronaApplicationMain( argc, argv, [MyAppDelegate class] );
}
return 0;
}
This is my MyAppDelegate.h
//
// MyAppDelegate.h
//
#import <Foundation/Foundation.h>
#import "CoronaDelegate.h"
#interface MyAppDelegate : NSObject< CoronaDelegate >
#end
And finally, this is MyAppDelegate.mm
//
// MyAppDelegate.mm
//
#import "MyAppDelegate.h"
#import "CoronaRuntime.h"
#import "CoronaLua.h"
#implementation MyAppDelegate
- (void)willLoadMain:(id<CoronaRuntime>)runtime
{
NSLog ( #"willLoadMain" );
}
- (void)didLoadMain:(id<CoronaRuntime>)runtime
{
NSLog ( #"didLoadMain" );
}
#end
I am not posting my main.lua as it seem irrelevant. If I am not posting something that is important, then apparently I am assuming that it is not.
When I run the app in xcode iOS simulator, I get a black screen and my willLoadMain and didLoadMain are never called.
Please let me know if you see something that I am missing.
Thanks,
Roger
My problem was that somewhere I read that I should remove the .xib files (this was not needed). Once I re-added them to the project and updated the app-info.plist, everything began working again. Since I am rather new to Corona Enterprise, Lua and Objective C, I do not understand the details of why this failed and then began working. At any rate, this issue is now resolved.
Im getting the following error when hitting the email button in my application on the simulator. Im using the same code form a previous application so the code must be ok
int main(int argc, char *argv[])
#autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
Im having trouble interpreting what this means, the debugger says
argc = (int)1
argv = (char**) 0Xbffff594
*argv = char 0xbffff6b8/users/library/apllications/5.1/applications/FBA888AA-xxxxxx
In thread 1
0x0028b626 <+1163> xor %eax,%eax
0x951929c6 <+0010> jae 0x951929d6 <__pthread_kill+26>
I have rebooted machine, still same error
Could anyone offer any advice?
Add this line to your App-delegate in .h file#property (strong, nonatomic) ViewController *viewController;
and this line to your App-delegate .m file #synthesize viewController = _viewController;
Add this line to your App-delegate in .h file
#property (strong, nonatomic) UIViewController *viewController;
and this line to your App-delegate .m file
#synthesize viewController = _viewController;
It looks like you may have a connection broken. You should double check all your connections in Interface Builder.
Re-connect your connection or delete the connection.
I have the following code block, as the content of my AppDelegate.h of an iOS one view application:
//
// AppDelegate.h
// kompas
//
// Created by Attention8 Aps on 2/6/12.
// Copyright (c) 2012 Attention8. All rights reserved.
//
#import <UIKit/UIKit.h>
#class ViewController;
#interface AppDelegate : UIResponder <UIApplicationDelegate>
#property (strong, nonatomic) UIWindow *window;
#property (strong, nonatomic) ViewController *viewController;
#end
This yields the error "Expected identifed or '('" on the line
#class ViewController
I have tried comparing it with the AppDelegate.h from a newly started project, but I can't for the love of god spot the error. The mistake has arisen after tinkering with other files, but I can't seem to locate this issue.
Any help as to what could be the cause of this would be greatly appreciated.
It's probably a problem with another file. Try going through all your other classes and getting rid of any warnings/errors with them.
Try to open this file in vi. Sometimes invisible characters causes such errors.