The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > Developer > Omni Frameworks
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
how I built TextEditor with iOS5 beta and XCode 4.2 Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Hi all-

I spent a few late night hours attempting to build against the latest betas.
Just wanted to share my experience building the frameworks with SDK iOS5 beta and XCode 4.2beta.

NOTE:
- iOS5 is still a beta under NDA. So I can't discuss any of the new APIs here. Nor does this build attempt to use any of the new features.
- My goal is simply to run TextEditor under the latest iPhone and iPad iOS5 Simulators and devices allowing __IPHONE_OS_VERSION_MAX_ALLOWED > 3.2 ... simply the way I wanted to run this experiment. You decide if it's appropriate for your configuration.

Before we begin, a short description of my Environment:
Mac OS 10.6.7
iOS4 and XCode 4.02 latest build installed in /Developer
iOS5 and XCode 4.2 build 4C104 installed in /Developer_Beta

1. Download the latest code from github

2. Load the new TextEditor workspace. Make sure you open with the XCode 4.2 beta if you are running parallel environments like me.

3. XCode 4.2 suggests a whole bunch of little project optimizations. Accept them all, especially any that are related to your base sdk (which should eventually default to Latest)

4. Builds use the latest Apple LLVM Compiler 3.0 and analyzer. I got a multitude of warnings and errors. Most are simple to resolve and related to deprecated functions, casts etc...Handle with care and make sure you understand what you're doing. I didn't "relax" any of the compilation options and warning, just straight out of the box XCode 4.2beta conversion of a workspace that was built for XCode 4.0.

A few things to note:

The frameworks try and preserve backwards compatibility for iPad 3.2 devices and libraries, so I usually ifdef'ed around the offending statements opting for newer iOS4+ APIs with statements like:

Code:
#if __IPHONE_OS_VERSION_MAX_ALLOWED <= __IPHONE_3_2
            return [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:nil] autorelease];
#else
            return [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil] autorelease];
#endif
Another example is OmniFoundation's custom OFFIleWrapper Class vs. new iOS4+ NSFileWrapper support. I opted to use the newer apis, so I effectively "turned off" OFFILEWRAPPER_ENABLED for anything above iOS3.2 (my case) in OFFileWrapper.h

Code:
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED <= __IPHONE_3_2
    #define OFFILEWRAPPER_ENABLED 1

...
...

#endif
Other related changes will be necessary, but they are pretty simple to fix.

5. Past compilation, you may get a linker error that I tracked down to the TextEditor Target's Framework search path, so I changed

"$(SDKROOT)$(DEVELOPER_FRAMEWORK_DIR)" to
"$(SDKROOT)"

This cleared the invalid framework path the linker was complaining about.

6. I got linker errors related to SentestingKit and non-386 compatible symbols. I never got touch tests with SentestingKit Framework to build correctly. Too much of a headache for now, so I removed the dependencies to the lib...Tests.a libraries...Oh well.

7. Done!

That's it, you should be able to Run TextEditor in the iPadSimulator 5.0. If there's any interest, I will upload my project to a forked github repository to share. Note: I haven't completely tested the app, especially with respect to my small changes to make it build using newer apis. Left as an exercise.

Your feedback is welcome.

Have fun. Bye.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
iOS5 Killer addition > You can flag mails > You can script mail rule to add to OF :)) stevenjohn OmniFocus for iPad 16 2012-08-07 10:24 AM
iOS5 Background Syncing skotleach OmniFocus Syncing 1 2011-07-29 04:46 PM
Looking for iPad developer to customize Omni's RTF texteditor. appapps Omni Frameworks 0 2011-01-18 11:13 AM
Probably very simple: I can't run the example TextEditor philipkd Omni Frameworks 2 2010-10-31 11:16 AM
Can't run TextEditor example. iamamused Omni Frameworks 5 2010-07-02 09:42 AM


All times are GMT -8. The time now is 05:00 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.