Alamofire installation problem on testing iPhone - swift

Hello I installed Alamofire 5.0 via pod and I try to run it on the real phone.
The project is empty only Alamofire and a contentView say hello world.
if a run it on simulator it work perfect, if I run on the real phone I get the following warning. (I authorized in general setting the app)
any solution? I don't know what is this
/private/var/containers/Bundle/Application/C526B7F7-4337-4D36-A9EB-C56913D97329/FlyWeatherX.app/Frameworks/Alamofire.framework/Alamofire: code signature invalid for '/private/var/containers/Bundle/Application/C526B7F7-4337-4D36-A9EB-C56913D97329/FlyWeatherX.app/Frameworks/Alamofire.framework/Alamofire'
thanks for the help

Check the version of your ios on your phone is it matching the version of ios on xCode or not.
also if your iphone under ios 13 then
first - choose from xcode your exact iphone version from the building tap
second - delete the SceneDelegate file and then go to AppDelegate and remove the last two functions then before the first function just implement the view by writing :-> var window: UIWindow?
then run the project and see what is the next ..

Related

What should be my entry point if my MacOS app has no UI?

i have a macos app that has no UI, its a Launch Daemon, and since this is my first app i wanted to check if im doing things right.
Is it ok to start running my code in the AppDelegate method applicationDidFinishLaunching or should i make another file my entry point. I read somewhere that im supposed to make a main.swift file but i havent found information about that.

Swift macOS Application Determine Which Window Appears at Launch

I am working on a Cocoa macOS Swift project built using Swift 4 and Xcode 9, and I want to achieve the behavior of an application changing the first window that appears based on a UserDefaults variable. I have seen examples of this done in iOS applications, but after testing some of the available code, it seems that in this case the iOS examples do not work for macOS. In my application's delegate, I can check the value of this variable, but how would I efficiently and properly act upon it?
Ideally, if a certain condition is met Window 2 would appear at launch and Window 1 would not appear. If that condition is not met, the application would display Window 1 at launch. Thanks in advance!

Could not instantiate class named UICollectionView

"Could not instantiate class named UICollectionView" I am new to iOS6 please explain why the above error is coming?
I am getting this error when i trying to convert the StoryBoard project for UIViewCollection
to nib using this example
You are probably running your app with an iOS version below 6.0 - upgrade your device or use the appropriate iOS Simulator version.
I was using ios5 simulator, when i changed the simulator to iOS6 it worked.
It was corrected a long before,forgot to update on stackOverflow.
Thanks for answer anyways.
+1 for user1034669.

How to make iAds work on a 3.0 + iPhone-iPad app?

I created a universal app for the iPhone-iPad. I'm only working on the iPhone part at the moment. In the header file for the view controller for the iPhone one, I import the adbanner header and create an adbannerview variable with a matching property. I don't make it in the nib file but rather check at run time if the class exists, if it does, I create an adbanner programmily and then attach the adbannerview variable to it so I can refer to it inside other functions. Everything works on the 4.0 simulator. I also weak linked the iad class.
So if I take the same code to an earlier version of xcode and try to run using the 3.0 sim, it gives all these errors saying I can't import the header and make the adbannerview variable and the property, how do I get around this?
Thanks. If you need more details or my code, just ask.
The AdLib Framework and iAds are only available in iOS > 4.0. For example, see the docs for ADBannerView:
Availability Available in iOS 4.0 and
later.
If you are trying to build the app on an older version of the sdk (not just run the binary on a older device) and are getting errors when you try to import the headers like your question suggests, you could try wrapping the imports that fail in a #ifdef directive that tests for the availability macros from Availability.h, something like:
#ifdef __IPHONE_4_0
// iOS 4 specific imports here
#endif

Universal iPhone/iPad application debug compilation error for iPhone testing

I have written an iPhone and iPad universal app which runs fine in the iPad simulator on Xcode, but I would now like to test the iPhone functionality. I seem unable to run the iPhone simulator with this code as it always defaults to the iPad?
Instead I tried to run on the device and as it begins to run I get the following error:
dyld: Symbol not found: _OBJC_CLASS_$_UISplitViewController
Referenced from: /var/mobile/Applications/9770ACFA-0B88-41D4-AF56-77B66B324640/Test.app/Test
Expected in: /System/Library/Frameworks/UIKit.framework/UIKit in /var/mobile/Applications/9770ACFA-0B88-41D4-AF56-77B66B324640/Test.app/TEST
As the App is built programmatically rather than using XIB's, I've split the 2 device logics using the following lines in the main.m method:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
retVal = UIApplicationMain(argc, argv, nil, #"AppDelegate_Pad");
}
else
{
retVal = UIApplicationMain(argc, argv, nil, #"AppDelegate_Phone");
}
From that point forth they use different AppDelegates and I've checked my headers to ensure the UISplitView is never used nor imported via the Phone logic.
How do I avoid this error and is there a better way to split the universal logic paths in this programmatically-created app?
That error is being triggered because you didn't weak-link the UIKit framework. The UIKit framework in iPhone OS 3.2 added the UISplitViewController, and if you link it in as normal your application will assume those symbols exist on 3.0, where they don't.
To weak-link a framework, find your application target in Xcode, inspect it, and go to the General tab. At the bottom of that tab should be a list of frameworks, with a column for Type. Change the Type for UIKit from Required to Weak and rebuild your application. That should take care of the runtime errors.
Your conditional logic is sound, but I tend to share an application delegate and do the interface-specific layout further down the line.
(Update: 12/21/2011) As of iOS 4.2, you should no longer need to weak link frameworks to prevent errors like this. As Marco Arment describes, if you build with iOS 4.2 or later and target down to iPhone OS 3.1+, individual classes are now weak linked and should have their +class method return nil if the class does not exist on the currently running version of the OS.
I was having a very similar error and it was driving me nuts! :-) Searching for hours and couldn't figure it out...
Like you said, everything was fine when running in the iPad Simulator but when trying to test the App on the iPhone with iPhone OS 3.1.2 it would not even start but crash with the following error message:
mi_cmd_stack_list_frames not enough frames in stack
By checking nearly every line of code I realised that the allocating of 3.2 classes like UIPopoverController or UISplitViewController (already inside forked iPad-specific code) was causing the problem.
So instead of i.e.:
infoPopover = [[UIPopoverController alloc] initWithContentViewController: infoNavController];
i would write
infoPopover = [[NSClassFromString(#"UIPopoverController") alloc] initWithContentViewController: infoNavController];
and that solved my problem! (Debugging can be so hard if the error message gives you no clue about where the bug could possibly be found...)
Xcode 8.3, iPad 2 (non retina), Swift 3 code
What helped for me was:
restart Xcode
do a 'Product -> Clean' ShiftCommandK
rebuild the project