iphone sdk 3.2 to 4.0 nib editing - iphone

So I am working on an app that was compiled on sdk 3.2 and 2.2.1, but I have sdk 4.0. When I compile it, I get many build errors "Pattern colors not supported by the iphone SDK for iphone OS versions prior to 3.0" and "setText is deprecated."
Furthermore, when I open a nib file and try to change the colors, add in an item from the library, or mess around with it my changes and additions don't show up during runtime. I am thinking this is an issue with the interface builder, particularly the different SDK versions.
Is this the case? I am programming for the ipad, so I need at least 3.2?

Open the .xib file in Interface Builder, then select Window > Document Info, select a later version of Deployment Target OS version.

Your errors of "setText is deprecated" is an error in your code because apple updated their framework. The easiest to fix that would be to check the framework for a comment that says what to use.
When you make a change to a nib file, interface builder and Xcode require that you save before building the project.
The iPad is only 3.2, so yes you will need to build it for iOS 3.2.

Sorry I am OP, had to create an account since I was using a temp one.
Thanks for the answer, however, I'm not too worried about setText is deprecated because it builds successfully.
Regarding the nib file, I did save, clean and rebuild the project. I'm working on someone else's code done in earilier sdk's, and when I delete their objects in IB the app will still run fine, as though the interface builder is not responding. I add objects in the nib and they won't show up. If I do this is projects I create, it goes through finely. My guess is it's the different sdks?

Related

iOS: Linking a third party framework and crashing when deploying

So, my problem is that I'm creating a framework to be used with iOS. It works great when in the simulator and when I'm debugging it on my iPad but as soon as I send it to anyone via Testflight (including my iPad) it crashes. The application will load the splash screen, then crash.
I tried symbolicating the report but I'm not getting anything out of it.
One time happened to me... xcode compiles the app for debug on the simulator, but for release on the iOS device. Then, the debug version doesn't do many enhancements.
Go to "Product" -> "Manage Schemes". There, if I were you, I would set everything to "Build Configuration": Release.
This way, you may be able to have the simulator crash... and it may be easier for you to figure out what's going on.
In my case, I was using a block but not copying it... then, on the release version, the compiler cleared the memory while on the debug version it didn't.
Hope it helps
So, the solution to my problem was that I was linking the framework but not copying it to the device, so when I debugged it with my iPad connected to it, it would find the references to the framework, but once it was deployed, the app crashed when it tried to find the framework.
The answer was:
Go to your project's build phases.
Add build phase > Add copy files.
Choose Frameworks in the Destination field.
Copy the framework.
Your app should now have the framework copied and installed wherever it needs.

New "objects library" in Xcode 4.2 with iOS 5

I am using Xcode 4.2 build 4C199(for MAC OSX 10.6.8). I create a new project and select the AppDelegate.h .m file and close the file. When I reopen the file I see a set of objects in the Objects Library in the Utilities panel that are either new or different. There are many more objects than usual. I'd like to use them, but when I click on either a .xib file or a storyboard file the new objects are replace by the normal old objects .Is there a way to access these new objects? Please refer my screenshots below.
These are objects, that are only available on the Mac platform. Please make sure you really created a project targeting the iOS platform. Have a look at the base SDK. It should specify an iOS SDK.
If something went wrong there just create a new project using the right template.
My project is iOS. I upgraded Xcode 4.3 to 4.3.3 last night and had the same problem on my first launch of Xcode after the upgrade: the object library contained only OSX objects.
It certainly looks like an Xcode bug. My workaround: in the Build Settings, I changed the "iOS Deployment Target" pulldown to a different SDK, then changed it back. After that, I got the iOS objects back.
See also here.

Newbie: Errors in an iPhone app

I'm really newbie in iOS and I have to handle a complicated situation. I was given an iPhone app developed by someone and I have to make it work. The guy who developed it has told me that it worked, but sometimes crashed in an iPhone. I've never developed using iOS and I don't really know how this app works.
Well, when I open the app with Xcode, the first problem that I detect is some errors with the references. The app uses the project CorePlot-CocoaTouch.xcodeproj. I've added again this project and solved the references (I've followed some other posts like this one: http://www.jaysonjc.com/programming/pie-chart-drawing-in-iphone-using-core-plot-library.html).
I want to test it with the simulator (I don't have an iPhone yet). I have a doubt here...should I use iOS Device, or iOS Simulator as Base SDK? Firstly I chose iOS Simulator, but it appeared a problem with Cocoa.framework (it turned into red).
Anyway, using iOS Device as Base SDK, I build the project and it says "Build failed (59 errors, 3 warnings)". I check out the errors, and most of them are "Expected specifier-qualifier-list before ..."
Can anyone help me? This is more or less the situation, but I can provide more specific details if they're needed.
I'm sorry if I'm talking about something really basic, but I've been trying to solve it for 2 weeks and I give up. I've tried to talk to the guy, but he's not really helpful..
Thanks for the replies!
By the way, I didn't say it and I don't know if it's relevant or what it means. The guy has a directory called "Libraries" where it's stored the CorePlot. The files there are the same than if you download the CorePlot project from other source. The only exception is a folder called "SDKBuild", which contains files like "build.sh", "iphoneos-SDKSettings.plist" or "iphonesimulator-SDKSettings.plist". I'm really newbie, so it's probably obvious, but I have no idea...
just try to add CocoaTouch framework to your project.
and for base SDK use "latest iOS".
Right click on the project name in 'group & files' set on the left of xcode. Choose add -> Existing Frameworks.
Find Cocoa.framwork and click add. Do this to all red colored framework.
Choose IOS Simulator as base SDK.
Try run it..
If you want to run the app on simulator, you have to build with iOS simulator. The base SDK basically sets the OS version (this will be the same regardless of whether you are running the app on simulator or device). You should be chaining the build settings to device only if the device is connected and if you have installed the appropriate provisioning profiles.

Will old source code run with SDK 4.2?

I've been working on creating my own iPhone app with source code my company gave me. This code was created with iPhone SDK 3.0. I've worked on it for over a year (I'm a designer so my coding is mostly copy and paste) and to test the app on my iPhone it says I must update my SDK to 4.2. I'm wondering will this break my app? I probably don't have the skills in xcode to upgrade my code if I am required to rewrite parts.
Thanks,
Chris
If none of the code has been deprecated, changed or even removed, chances are good it still runs fine. Most projects run, and if you have used external code (and hopefully noted where you got it from) there might be an update available for that piece of code.
Just set the deployment target to iOS 3.0 in your project settings
here some little explanation: link

Adding SDK-specific frameworks to Xcode

Xcode 3.2 kind of broke the build process of my iPhone app. I need to add a new framework to my project (MediaPlayer.framework).
So I go into my Target settings and try to add it to the "Linked Libraris" by hitting the [+] button. In the list the MediaPlayer.framework is missing, as well as other frameworks, such as UIKit, CoreGraphic and others. Some frameworks are still there.
I can add the frameworks by adding the SDK-specific ones (going into /Developer/Platforms/iPhoneOs.platform/...yadayadayada../frameworkd/) but then of course I can only compile for the iPhone platform and not for the simulator any more.
So basically I wonder how I can get Xcode back to chose the appropriate framework, depending on platform and SDK version for me?
Thanks and kind regards, Hans Schneider
Edit: Things I tried: Setting the Base SDK to 3.0 (was still 2.2.1), reinstalling 3.0 iPhone and Simulator SDK from the "packages" directory of the Xcode 3.2 DMG. Didn't help. The frameworks still wont show up in the list...
Edit 2: Ok, I now have the frameworks back in the list, I was previously in my AdHoc configuration. In Debug I have the frameworks back. But it still wont compile for the Simualtor (lots of Symbols(s) not found errors).
Looks like the linker doesn't choose the correct libraries and always uses the iPhoneOs3.0 path for the frameworks.
Goto 'Framework Search Path' in build section in target's property.
Add path:
$(SDKROOT)/Library/System/Frameworks
Then it should work well.
And once you press 'OK', you should be able to see the path is set to '/Library..."