Window-Based Application: Which one? - xcode

I have just downloaded the brand new cocos2d 1.01, and I am trying to create a new iphone/iPad project. I was reading online to go to /Developer/Library/Xcode/Project Templates/Application and make a copy of the Window-Based application.
Problem is, since that online-tutorial was written, there are a total of 6 options, including a Window-based iPad, a Window-based iPhone, and a Window-based Universal folder within that folder. If I am trying to develop an iPhone & iPad game that can serve as a universal app on the Store with cocos2d and Xcode, what option should I copy-paste onto the desktop (and then move forward with copying in the cocos2d files)?
I have tried searching this, but all the answers are old, (some as old as cocos2d .72!)

If you run the 'install-templates.sh' which is included with cocos2d. It will setup the xcode templates. Then you can just choose the cocos2d templates when creating a new project. By default(atleast on my machine) the device is set to iPhone. To change that just change the device or Targeted Device Family under the build settings for the project and target.

Related

Xcode 10.2, iOS 12.2 : Application installed over OTA(Enterprise) not opening

I have converted my web application into .ipa file using cordova. It was working well until the iPad is updated to iOS12. But since then, the app crashes even before launching.
I tried everything, having searched through various posts of stackoverflow, inlcuding
cleaning,
creating new provisional profile,
ensuring the .plist file contents,
changing code signing entity,
changing architecture in build settings,
redo everything from scratch
and etc.,
I have even created a new helloworld application from scratch. In Xcode, Product -> Run is working fine. But when I archived .ipa file through enterprise option, it does not work when I open Window -> Devices and Simulators -> Install.
FYI. I have tried with different deployment targets from iOS 9 to iOS12.2
Please help. Thank you so much.
Seyed Ismail.

Appcelerator App Conversion iOS to Android.

One of our developer developed an app in appcelerator using alloy framework for iOS which works fine. Now we want to run the same app in Android, since the appcelerator is a cross platform tool, we wish to make the Android version of the App. I tried searching about it and explored the applcelerator ide for options but couldn't find it. Can some one please guide me into the right direction?
First of all have a look at this link : http://docs.appcelerator.com/platform/latest/#!/guide/Supporting_Multiple_Platforms_in_a_Single_Codebase this will guide you to update the application for multiple platforms.
Their are basically two different ways to port any application from android to iOS or vise-versa, but before that just let me clear one more thing to you about tiapp.xml.
In the tiapp.xml of your project you need to updated the Development Target by checking for which platform you are developing the application for (iPhone, iPad, android, Mobile Web).
Option 1 :
Cross Platform is build to make code re-usable (i.e. re-use same code for all the platforms), but we have exceptions with many things. Their are lot of components that work fine in iOS but when you use them in android then you will face errors. So in that case you just need to apply conditions for android and iOS like below :
if(OS_ANDROID)
// do something
else if(OS_IOS)
// do something
What you need to do is that you need run the application in android simulator and test the application for these changes and then apply the changes accordingly.
Basically a developer has to target the UI for both the platforms, as their will not be any logical differences between the two. Also their will be UI changes between the same components, like for example a picker in iOS will not look the same as it will when you look it in an android application.
Option 2 :
Now in the project you have assets folder with the platform that you have selected in the tiapp.xml (i.e. iPhone, android etc).
You can create similar structure in the style and view folder, create two folders iOS and android in both the directory (i.e. style and view).
First, move .tss of style folder (except app.tss and index.tss) in the iOS folder, then copy the files in the android folder also.
Repeat the similar process with the View folder also.
Now you have two different structures (i.e. view and styles) according to their platform. Now you can run the application in android simulators and resolve the error that you face.
Hope this small information helps the cause, you can also have look at the documentation of all the components from below link :
http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView

Images not showing in iOS 7.1 with XCode 6 / Swift

I have this ObjC code:
[self.myButton setBackgroundImage:[UIImage imageNamed:[NSString stringWithFormat:#"%#-button", self.myObject.name]]
forState:UIControlStateNormal];
This works great with these combinations:
XCode 5, iOS 7.1
XCode 6, iOS 7.1
XCode 6, iOS 8
But when I port one single class of the project to Swift -- a class which is unrelated to anything that is happening in this code -- the images do not display in XCode 6 for iOS 7.1. It does work with XCode 6 and iOS 8.
I finished porting the entire project to Swift, so now the code looks like:
self.myButton.setBackgroundImage(
UIImage(named:self.myObject.name + "-button"),
forState: UIControlState.Normal
)
And it's still unhappy on iOS 7.1. Still no images. (The custom icon works, though.) Yes, I know this is just beta software, and it's probably just a bug ... ? But I'm just wondering if anyone has a solution or insight.
I only started using XCode and ObjC about a week ago (surprise! ObjC is now deprecated!), so it could be that I am missing something, but since it works in ObjC, and in Swift+iOS8, it seems like it's probably a bug.
I've managed to overcome this by not using Asset Libraries to store my images.
Add your images to the project using the "old style naming", like Image.png and Image#2x.png, then load them without any extensions in the filename, as such:
let myImage = UIImage(named:"Image")
Fixed in XCode 6 beta 2
Images from asset catalogs in projects with a minimum deployment target of iOS 7 or OS X
10.9 will be available when running on iOS 8 and OS X 10.10, and now also iOS 7 and OS X
10.9. (17029658)
release xcode 6 beta 2 notes
For me it was because I suddenly add jpg image to Image Assets. Just resaved it as png and all work well
I guess you are testing it on simulator. Make sure the desired image is copied to 7.1 bundle. To do it check copy resources bundle build stage or check manually app bundles for different simulators at ~/Library/Application Support/iPhone Simulator/.
#o KB o points out here that the Xcode6 Beta release notes mention that xcassets bundles aren't supported for iOS7. Additionally, I've found it surprisingly hard to get rid of asset bundles in your project. This can cause naming collisions if your images have the same name as images that were previously in the bundle (you probably want the same names, so you don't have to rename your images everywhere in code / IB).
Here's a workaround:
Copy each image out of your .xcassets image bundle to a new directory (let's call it Images/). See below for a script to make this easier.
Delete your .xcassets bundle. (surprisingly, removing it from the project isn't enough. In my testing, if the .xcassets bundle was anywhere in the same directory as the Xcode project or related sources, it would get copied in. Alternately, you can remove the .xcassets extension)
Add all your image files to your Xcode project
Clean (cmd + shift + k)
Delete the app from the target device or simulator
Install and run
To make step #1 less tedious, I wrote a script to copy images out of the .xcassets bundle and into a directory of your choice: https://github.com/johnboiles/xcasset_exporter
mkdir Images
./xcasset_exporter.py MyProject/Images.xcassets Images
I had a problem where some images in xcassets worked and others didn't (only for iOS 7.1).
I solved it by deleting the problematic image sets and creating new ones with different names.
If you are attempting to use an external bundle with proper PNG images stored in either an "old style" folder or inside xcassets then apps running on iOS 7 will not be able to access these images.
I tried a suggestion from another answer here to add the "old style" folder path of the images in the external bundle but that didn't work for me. My solution, which fit my scenario, was to expose an outlet for the resource in the nib inside the external bundle. This allowed the main app to set with an accessible image to it. Whether this is a bug or simply a constraint in using nibs contained in external bundles with iOS 7 will matter less as it rides on to the usage sunset...
PS: Apps running on iOS 8 where able to access images in the external bundle xcassets just fine so choose your poison for supporting iOS 7.

Xcode default scheme and architecture setting mismatch (iPhone development)

I am developing iPhone application and choosing to build iPhone project. However, I don't know which setting or which part I edited in info.plist. Now the default scheme and architecture is set to be Mac application development.
Can anyone tell me how to edit the .plist file or make any setting to make the project build in iPhone/iPad stimulator nor Mac, when I choose to build an iPhone/iPad project. (I had edited the plist file using terminal, so I not sure which part I did wrong and cause this problem).
Because now every iPhone application project cannot be built, even for the new iOS application project (due to the setting will auto set to Mac nor iPhone).
in the build settings for your project (and you may have to do this for each target) change BaseSDK to Latest iOS.
i have no idea why changing the info.plist in one project would affect any new projects you create, tho.

How to debug Unity project with iOS simulator?

As somebody said, the Unity project must be run on devices, but that is a lot of trouble. Is there any way to run a project in iOS's simulator?
Prerequisites:
Mac
XCode
Unity3D for Mac
Guide:
Go to Edit > Player settings > Inspector > iOS tab. Change the Target SDK to Simulator SDK then build the project again.
Open Build Settings and switch platform to iOS.
In the same window set Run XCode as Debug, check Development Build and Script Debugging.
Click Build and Run, choose a directory for iOS builds (for example, create a new directory named Build.iOS)
Build's a long process, take a break.
Unity3D documentation - Building your Unity game to an iOS device for testing.
It was supported until Unity3D 3.3. and iOS 4.??? But the current release 3.4 crashes. See this posting in Unity3D forum.
Anyway I find it easier to run the project in in editor player for debugging and do real testing on the device. Deploying to iPhone via XCode is always annoyingly slow. So I designed my code to distinguish at startup between device and player like
if (Application.platform == RuntimePlatform.IPhonePlayer) {
// do what ever you need
} else ...
Working with the abstract factory design pattern or singletons makes it pretty easy.

Resources