Am I using Core Location correctly? It doesn't seem to be working - objective-c

I just started doing some research into Core Location and it seems that the tutorials that I am following are not working for me. Even when I download the source code and run it, nothing happens. At present I have attempted this tutorial. When I run it, I get a popup asking if I want iPhone to use my current location. I press ok, and then nothing happens. Am I supposed to do anything else?
I am also using VMWare, and currently am unsure if this is the cause (although my internet connection works perfectly on it). I'm using base sdk ios 4.3 - running simulator.

In order for location to work, you need to be running the code on an actual device. The latest public iOS SDKs don't yet support location changes in the simulator. The simulator will always return 1 Infinite Loop, Cupertino, CA (Apple's headquarters) as the location.
See the Core Location documentation for more information on using location in your apps. (Although I can't find a citation for the limitation of the simulator at the moment.)

CoreLocation within the simulator is always going to return 1, Infinite Loop, Cupertino, CA, although Xcode 4.1 and iOS 5 have improved support for testing CoreLocation capabilities in the simulator.

iOS5 iPhone simulator supports location simulation.
If you are using 4.3, it does support location in some conditions. I notice that when I am tethering using my iPhone, my iPhone simulator is able to get location from my phone. I can see location update in my simulator when I'm working while commuting in a train. But this update is only through core location. Map gives u Cupertino unless u use iOS5

Related

Simulator/Device name shows only Unity-iPhone

Just loaded a project in Unity 3D (4.34f) it is working as desired, Built and Run for iOS devices. works perfect in the Xcode (5.1.1) simulator.
In the Simulator/Device Name is written Unity-iPhone, it does not show neither my iPad or my iphone when connected.
What am I missing? any help?
Easy, happens to me frequently, two choices deselect the Development Build in build settings or in the player settings change the dropdown list of Optimization SDK Version to "Device SDK".
Let me know if works for you....

Library not loaded

I added Social.framework in my application in the same way i use to add the other frame works. I have downloaded xcode 4.5 and iOS 6 . but my application crashes with follwing error only on device. It works fine on simulator.
dyld: Library not loaded: /System/Library/Frameworks/Social.framework/Social
Referenced from: /var/mobile/Applications/FC88291D-2052-45D6-A7BB-65CE340F07BF/Uploading Image.app/Uploading Image
Reason: image not found
I was getting this exact error. My app currently has a deployment target of 5.1. I wanted to add Facebook sharing. I found this old post, Conditionally including a library for different iOS SDK versions?. All I did was set "Social.framework" to 'optional' and it did the trick, then my app would run on ios 5.1 and ios 6.0. Of course you need to do checks at runtime for what OS the device is running otherwise you could run into a crash if you try to access social.framework in ios 5.1 or earlier. Hope that helps!
In Xcode go to targets, Go to build phase and search for Social frame work you will find that under "Link Binary with Libraries" section. There select social frame work and see there is an option on right hand side required/optional in that just change required to optional. Now you are able to run on all ios devices without any crashes.

Where can I find an iPhone simulator for Xcode 3.1.4

My kids want to learn to write apps on their MacBook which currently runs OS version 10.5.8.
I have downloaded Xcode 3.1.4 but it doesn't seem to have the iPhone Simulator.
Does anyone know where I can find this?
(And are their better tags I should use for this question?)
Thanks.
(UPDATE: I down loaded the " xcode 3.2.6 & ios sdk 4.3" dmg file from Apple in the hopes of accessing just the "iPhone simulator" but repeated attempts to open the .dmg file on my OS10.5.8 Macbook result in a complete, "blackscreen" crash.)
I am really very sorry because this is not straight to your question. But if I were you, I'd like to encourage them to start with Android. To me, an open-platform is more preferred. Beside that, Java is a strong/ dynamic language when comparing to C/C++.
Android developer site
Eclipse IDE
Android SDK
ADT plugin for Eclipse
API guides
Training videos
Hope they will like :-)
Are you sure the simulator was not included? One thing to remember is it won't be shown with xcode in your applications folder.
To use the simulator you have to launch it from xcode by pressing the play button in the top left corner of the interface. If you have already used xcode with an iPhone/iPod/iPad make sure you select simulator from the drop down next the play and stop buttons(press and hold to change what is selected).
If you want to make sure you can access the simulator without xcode, launch the simulator as described above and then right click(or ctrl click) the icon for the simulator and select keep in dock from the options menu.
Hopefully the above helps you with your problem. If xcode truly did not come with the simulator your best option is to uninstall xcode(after backing up any projects) and trying a fresh install. Also try checking Apples dev center (https://developer.apple.com/devcenter/ios/index.action) for information about xcode and the simulator.

iPhone simulator: Is it possible to restore a real iPhone backup to it?

as the question says, I have a backup of an actual iPhone. Now I want a "copy" of the content in my simulator. The reason is that my real iPhone contains third party application data that I want to have in my simulator too.
Is that possible?
Thanks,
Norbert
Definitely not possible, because apps have to be compiled specifically to run on the simulator and iPhone, and such builds are not compatible with each other as they are built to run on different processors.
Edit to add: you can copy data/content (and you can, for Apple-supplied apps like the Address Book that are provided by Apple for the simulator) but unless you have a version of the app compiled for the simulator that can run, the content is obviously no use.
You can try to trick the Simulator by putting files there:
~/Library/Application Support/iOS Simulator
You can also put the files you need in your application project or have a look at Apple Documentation about Application Data1

Can I build for 4.x simulator but run in 3.x simulator?

Ok, there have been some questions alluding to this before, and I've even read some second-hand reports of people successfully doing this, but so far I haven't found a concrete answer.
Basically, I want to build an application for simulator using iOS 4.x, and then run it on a 3.x simulator.
I have both SDKs installed, so all I need is the last mile of getting the app to show up in the 3.x simulator.
I tried just copying the app across from Library/Application Support/iPhone Simulator/4.2/Applications to Library/Application Support/iPhone Simulator/3.0/Applications but it doesn't show up when I load the 3.x simulator. There's a binary plist called applicationstate.plist, which I'm guessing keeps track of what apps are installed on the simulator, but I don't know what the binary format is so I'm kind of stuck at this point.
Has anyone managed to load a 4.x app onto a 3.x simulator? And if so, how did you do it?
Why are you even trying to do this? What are you trying to achieve? If what you really just want to do is ensure the app works on iOS 3.x then simply state that in xcode and don't worry about the actual simulator. The simulator could be running iOS 5.0 for all you should care as long as you have set 'iOS Deployment Target' to '3.0' in xcode's project settings. That will ensure the application is compatible with iOS 3.x and above. Obviously you then still need to ensure you're not calling methods from SDK 4.x when it will run on an iOS 3.x device. If that is what you're trying to test then what you're doing won't actually work. You should (as Apple advises) always grab hold of a real device running the target firmware version and test it on that. Grab an old iPod for example with iOS 3.x and try testing your app on that to ensure you haven't called iOS 4.x methods when running under an older firmware.
The answer is: No, you cannot build for 4.x simulator and run on a 3.1.x simulator or earlier due to fundamental changes in the way the simulator works.
The only way to test 3.x support is to either run it on a 3.x device (after setting min deployment target), or build on an older xcode that supports 3.x simulator (which isn't feasible if you use Xcode 4, except for iPad 3.2).
Note: Setting the deployment target does not test compatibility with older operating systems. It's the operating system that it actually RUNS on that matters (such as "iPhone 4.3 Simulator", "iPhone 4.0 Simulator", "iPad 3.2 Simulator", or an actual device).
Of course, now that 3.x users make up less than 10% of the total population, it's not really worth the trouble to support it anymore.