Building with iOS7 produces iOS6 looking widgets - ios

After moving to XCode 5 and the iOS7 base SDK, some of the UI widgets in my app still look like iOS6-style (gradients, frames) on iOS7 devices. This doesn't happen on the equivalent emulator for iOS7. This also doesn't happen for all widgets, UIDocumentInteractionController's popup looks like iOS7 on device, but UIPopoverController doesn't. The keyboard for renaming a file also shows this discrepancy between emulator and device.
How does iOS determine the visual style of UI elements? Is it based on a statically linked library or something determined at runtime? I've tried purging the app from the device completely, but no change.
Emulator for retina iPad: UIPopoverController
iPad 3rd gen with iOS 7: UIPopoverController
The code in this case is fairly straightforward, no customization of the rendering or layout.
self.poController = [[UIPopoverController alloc] initWithContentViewController:audioCopyController];
[audioCopyController showDoneButton:NO];
audioCopyController.view.frame = CGRectMake(0,0,350,250);
_poController.popoverContentSize = audioCopyController.view.bounds.size;
_poController.delegate = self;
[_poController presentPopoverFromRect:view.audiocopyButton.frame
inView:view
permittedArrowDirections:UIPopoverArrowDirectionDown
animated:YES];
Thanks for the help in advance.

Check you Project config file and Target config file.
It is probably set with an iOS 6.X base SDK.
For this:
Go to your project config file in Xcode 5
Click the Build Settings tab
Edit the base SDK field to switch it to iOS 7.
Sometimes, we've experienced issues with Xcode not taking the current setting into account.
Changing it and compiling helps it understand that it needs to be changed.
Make sure you configure this correctly for your Project config and each and every target config file you run this from.
You might well have 2 different targets for simulator and for your devices.
Hope this helps
Regards
David

Ok, I found out what the problem was. David's suggestion got me thinking.
I am maintaining multiple apps at the same time, and one of them is quite old. The new Interface Builder in XCode5 breaks the transparency for a lot of the fields in the old app so I was keeping XCode4 in a separate installation folder alongside of XCode5. It seems that somehow my XCode5 project was still pointing at the SDK folders of XCode4 (not sure how this was possible, looking at the actual linker command line would probably shed some light), so after deleting XCode4's 6.1 SDK folder from my machine, a clean build with XCode 5 produced the correct iOS 7-looking widgets in my iOS-supported app.
The moral of the story is, be very careful with multiple XCode/SDK installations on the same machine. Hopefully this can help other folks who may be trying something similar to provide support for legacy apps.

Related

CCMenuItem doesn't work (Xcode 7.3~)

I’m a Japanese game developer. I develop some games with cocos2d-x.
I’m confused by the following problem. So, if you any idea, please help me.
When tap the button put on a cocos2d-x layer, the button doesn’t work.
If the button be tapped, the call-back function of the button doesn’t be called.
I have found some workarounds of the problem. However, I have no idea why the problem occurs. And, I want the most suitable way, how to fix it.
The following are develop environment and mobile devices that the problem occurs.
■ Develop environment
Operating system : Mac OS X El capitan(10.11.5)
Xcode version : 7.3 - 7.3.1(7D1014)
cocos2d-x version : cocos2d-x-3.2
build config. : Test / Release
■ Mobile devices
iPhone4s(iOS 9.3.2), iPhone5(iOS 9.3), iPad mini(iOS 9.3.1)
If mobile device's condition (iOS version etc.) is different, the problem may not occur.
And, the apps built by Xcode 7.2.1 or older version have no problem. it work normally.
The problem doesn’t also occur with the apps built by Debug build mode.
I attach a sample code.
https://github.com/SeanIchikawa/SampleProject/tree/master/CCBTest
The button of the layer is made by ccbi (ccbi = cocos builder file).
The call-back function is referenced to the button by "Selector" in the ccbi file.
■ About the sample Xcode project
Xcode Project name : CCBTest
ccbi file: Resources/simple.ccbi
Class file (written about layer) : Classes/SimpleView.h
If you any idea, please give me.
Thank you for reading my question.
The only way I've found at the moment to work it around is to downgrade Xcode to 7.2.1, having exactly the same problem but with CCButton instead.
Older Xcode versions can be downloaded from here: https://developer.apple.com/downloads/
This issue only occur if you are targeting a 32-bit architecture device with -Os optimization.
Set the optimization to -O1 in your release build could walk around this issue for now.

EXC_BAD_ACCESS when trying to run Unity game on iOS simulator

I'm usually not a Mac/Xcode user, please forgive me for incorrect terms or understandings.
I have a 2D Unity game which I can successfully build and run on Android and Windows Phone devices/emulators. When building for iOS, I can successfully create the Xcode project, open it and build the app in there. The only change in the iOS-specific player settings I made was to set SDK Version to Simulator SDK.
However, when trying to run it inside the simulator, the splash screen appears, then Xcode pauses on something that looks like an assemby file with an error message: Thread 1: EXC_BAD_ACCESS (code=1, address=0x4).
As I had no idea on what to do, I started stripping down my project (in Unity) until I had no more gameObjects but the camera left on the start scene. Also, I removed all other scenes from the build. The only thing that changed was that above error message now seems to appear on another assembly file.
What could be the issue here? How should I investigate further?
Update
This is the stacktrace:
Update 2
I've created a new blank Unity project, and I get the exactly same error there. The problem seems to be related to Unity or my machine, not the app itself.
Workaround
After days of researching, I still couldn't resolve the issue and finally built for a real devices instead of the simulator. Since I don't own one, I "blindly" submitted the result to the app store, and it got accepted.
For me, that's the proof that the issue is solely related to the combination of Unity and the iOS simulator, i.e. that those two don't work together reliably.
On the other hand, it seems relatively safe to assume that an app will work on iOS if it's been successfully tested on Android, Windows Phone and the default player. Of course, unless iOS-specific features are implemented.
I only know one reason, that leads to this behaviour (device builds work, but simulator builds won't).
=> This could happen, when using native iOS code / plugins
To fix that, you'll have to modify the <path-to-xcode-project>/Libraries/RegisterMonoModules.cpp file, cause somehow Unity does not register those classes/methods for the simulator.
Just look for #if !(TARGET_IPHONE_SIMULATOR) defines and shift them to have all your plugins included, also in the simulator. There will be some move mono_dl_register_symbol() that you'll need.

Xcode stops autocompleting, UIKit classes not available

The topic has raised several times within the last weeks. Till now I haven't found a proper solution. Is it just a momentary Xcode bug or is there more behind it?
Scenario:
In one of my projects autocompletion has stopped working when I last opened it. Other projects are not affected. It looks kind of reasonable that once this problem is around, I also can't cmd+click the different classes imported by UIKit anymore like UIViewController or protocols like UITableViewDataSource within this particular project. An error pops up "Symbol Not Found". So in a way, even though it is working fine when running the app, it is just not available from inside the files.
Restarting Xcode, deleting derived data etc. hasn't brought me any further so far.
Any ideas? Or - like mentioned - really nothing else than just a bug?
I don't know which part exactly was the key issue but
Installing Xcode 6.1
Downloading iOS 8 libraries & Xcode 6 libraries within Preferences
solved the problem.
Setting active scheme works for me.
You have to select proper device corresponding to your installed components.
XCode 6.1 has iOS8 primary, so you have to select iPhone6 or Resizable iPhone, if you select iPhone5 it couldn't find it.
(project name>device) on the right of the 'Stop running' button

iOS 5.1 crashes when using collections view

I am trying to use collection view and I want to support 5.1. I am not using story board. I have added collectionview to my view controller. I am identifying the version and opening collection view if its 6.0 or higher else opening another view controller. When I run my application in 5.1 it immediately crashes with error :
Symbol not found: _UICollectionElementKindSectionHeader
I have seen the link below it only describes the case when you use story board.
How to use UICollectionViewController in storyboard while still supporting ios 5.1?
Any help would be appreciated.
Thanks
Are you sure you've set your deployment target to iOS 5.1 in your app target in your project?
That should cause the following:
"...Framework APIs that are unavailable in earlier versions will be weak-linked..."
(from the quick help of IPHONEOS_DEPLOYMENT_TARGET).
If it's crashing immediately upon launch, it sounds like it's not being weak-linked.
If you're sure you've set a deployment target of iOS 5.1, you could try forcing the entire UIKit.framework to be weak-linked to troubleshoot the issue. To do that, you mark it as Optional as opposed to Required in the Linked Frameworks and Libraries section:
FWIW, I've been able to successfully do what you're describing in a Mac OS X application: I have an app built against the latest SDK, and at runtime, check the version of OS X and load different nibs. In the nibs for later versions of OS X, I can make use of UI elements that did not exist in earlier versions of OS X. Provided your app is nib-based, I can't see why you wouldn't be able to do the same in iOS. (Note that if you're using storyboards, that's a different story).
Here's an example project of how to set it up:
http://www.markdouma.com/developer/CollectionViewFinagler.zip
UICollectionView is not supported in iOS5. You can only use it with iOS6 apps. Sorry, but you are out of luck with it.
Here is an open source project that should help you out though, as it is defined:
Open Source, 100% API compatible replacement of UICollectionView for
iOS4.3+

iPad apps never install in Retina simulator

I've racked my brains over this one, and I'm probably just making a stupid mistake. After switching to Xcode 4.5.1 (it may have happened at 4.5) I simply cannot load an app into the iPad Retina simulator. I've edited the compilation scheme to say to always use the Retina display for the iPad. No love. It used to be that you could change simulators on the fly and whatever one was open would be the one the project compiled for. But I can't figure out how to do this in 4.5. Help!
Something funky is going on, which seems to be not acting as expected. Try these solutions in the following order.
Your method is correct, you set your Simulator Display preference when editing your schemes. Make sure your destination for the scheme is the iPad simulator, that it's tied to the Run scheme, and set iPad Simulator display to Retina. Save/apply your scheme changes, try to run your app. If that doesn't work, close + re-open Xcode, check scheme settings to see if they stuck, and try again
You may want to double check if your changes stuck. Delve into your project file (by right clicking on your project file, and selecting "Show Package Contents"). Then navigate to:
xcuserdata->username.xcuserdatad->xcschemes->ProjectName.xcscheme
Open it up in your favourite editor, and check to see if there's a:
simulatorIPadDisplay = "2.000000"
...for your required scheme
If none of that worked, then it may be an issue with your derived data (unlikely, but step 1 should have worked). Go to Organizer, and select the Projects tab. Then hit 'Delete...' for derived data. Do the same as before; run, close Xcode, check and re-run.
Well we really are in a pickle, that is the only method to set your preferred simulator display for a build scheme. You may need to resort to removing Xcode and re-installing, and trying the previous steps again.
What on earth is going on?! We've exhausted our methods, you may need to let Apple know about this issue.
Well, after a long session of "find all of my settings files and save them, delete Xcode and all of its settings files, reinstall Xcode, re-download simulators and dockets, replace settings files, etc., etc." I found myself in the same position. No Retina simulator for me.
The problem wasn't Xcode or the project file--the 5.0 simulator will simply not launch in Retina mode. The 5.1 and 6.0 simulators work fine, as I discovered when I switched to them in the compilation scheme. Switch back to 5.0 and I'm stuck in normal simulator mode. The reason I've been using the 5.0 simulator was to test lowest-common-denominator iOS features. That, and there is a bug in iOS 6.0 that affects large packet transfer via IPSec that hasn't been fixed yet.
So, I still don't know what the missing Derived Data status was all about, except that it's fixed now and I assume that reinstalling the app was the fix.

Resources