Archive for category iPhone & iPod Touch

Finding Xcode’s Pre-defined Macros for iOS Devices

I regret not making better notes about exactly why I was looking for a full list of the pre-defined macros Apple made available for iOS development.  I usually like starting an entry talking about why I was trying to solve a particular problem.  While I made a note to write up what I found, I did not note why I needed it at the time.  Assuming you are reading this because you need or might need such a thing, I’ll write on.

Some of the pre-defined macros are published in Apple’s documentation, but not all.  (Well, as far as I remember anyway.)  I feel the most confident that I didn’t miss one that could solve a problem when I get the list from the compiler itself.

While searching the internet I found instructions to use

I changed ‘i386’ to ‘armv6’ and ‘armv7’ but that failed on my setup.  I don’t really know if I messed something up in the /Developer folder or if this line just generally won’t work for ARM.

The error message mentioned a missing file and after finding it, I changed the above command to this:

For Xcode 3.2.5:

For Xcode 4.2.1

Change the “armv6” to “armv7” and vice-versa as needed.

Tags: , , , , ,

Fix to Symbolicate System Symbols in iOS 5.0.1 (9A405) Crash Logs

I found this one many weeks back and had it in my to-do list for the blog.  Now that 5.1 is out, I feel guilty I didn’t write it up sooner.  But then, my day job is keeping me very busy.

I had a long period where I could not fully symbolicate crash logs that were made by iOS 5.0.1 devices.  The symbols of my app would be symbolicated, but the system symbols of the device would not.  I was especially frustrated because a coworker with the exact same version of XCode could symbolicate those system symbols with no problem.  Neither of us knew why.

After a huge amount of searching with Google and reading items on StackOverflow.com,  I finally found a note saying the symbols in the iPhone 4S were corrupted somehow and they should be replaced with symbols from another device.  I don’t know if there was a problem with all the iPhone 4S devices, or just some of them or just early ones.

As much as I tried to do this,  I still could not symbolicate properly.  I triple-searched my computer for all copies of symbols for 5.0.1 (9A405) and removed them.  (You can compress them into .zip files if you want to keep them just in case.)

What I needed to know was to look in ~/Library/Developer/Xcode/iOS DeviceSupport   Xcode 4.2 had been putting device symbol information in there.  Once I got rid of that folder, and attached a device, XCode pulled a new copy of the symbols and symbolication worked like a charm.

Top top it all off,  something about the symbolication script in XCode 4.2 works better than any of the previous symbolication scripts, either from Apple or from any developer site.  While symbolication inside XCode can be horribly slow, it does work pretty well.

Hope that helps

Tags: , ,

Getting more Work done with an iPad

In response to the notion that iPad is just a toy or just a consumption device,  I’ve prepared the following from many discussions with people over the last few weeks.  I’ve debated calling this “How the iPad is a Great Work Device” among other things.

This list is a bit focussed for certain kinds of work being done, but it still is relevant.  The iPad is particularly strong when work must be done in small groups of 2, 3, 4 or 5 people.  Some of these advantages may fade for larger groups.

Some of the items listed may be valid only in the United States.  Check before buying if you have any questions or doubts.

Speed:

  • Wakes from sleep faster than a laptop.
  • Gets applications started faster than a laptop.  (Less time to get started with that quick presentation.)

Speed becomes very important when you have to consider other people’s time.  Think of those hallway or elevator presentations you have to finish in 90 seconds.  If your work involves pitching work, proposals or giving status updates, or just bragging,  you probably show pictures, video, or slideshows or documents to people on the fly.

Also, if you are trying to recapture time that would have otherwise been wasted (listed elsewhere in this article),  the speed is crucial to being able to use small amounts of available time.

Efficiency for Working:

  • A touch interface is often easier and faster to use than a mouse. Gestures and special meanings assigned to taps of 2, 3 or more fingers make many common tasks easier. Especially easy are tasks related to viewing, reading, sharing or showing things.  They may not seem like much, but if you are doing them many times per day, or have very little time, they add up.   Tasks like:
    • Zooming In and Out
    • Scrolling or Sliding
    • Page Turning
    • Link Clicking
    • Object Resize and Rotation
  • Work that would have required manually writing notes on paper then re-typing them later at the computer can now be finished immediately.
    • With protective coverings, iPad can be taken to the scene of the work in environment too harsh for normal laptop-style devices,  allowing single-entry data collection.
  • More information can be carried, acquired, viewed and presented in a single device.
  • Time that normally would have gone to waste can be re-used doing some quick tasks such as reading email, looking up information, reading relevant news, or creating some kinds of documents.  Examples of time recapturing opportunities:
    • Waiting in lines (at airports, car rentals, taxi lines, banks, medical offices, schools, etc.)
    • Waiting for meetings
    • While traveling (only if someone else is driving and its safe)

Quality Hardware:

  • Easily operated within an ordinary 1-gallon ziplock bag for wet environments such as rain, boat, beach, poolside, tub, etc. (Use this tip at your own risk. See Warnings and Updates in footnotes**)   Note that conductive anti-static bags used for shipping many electrical devices will probably prevent the iPad touchscreen from sensing fingers.
  • Excellent monitor which is better for viewing video is also better for viewing in general.
  • More rugged than most laptops.
    • no hinge to break.
    • no keys to be popped off.
    • few port connectors to break.
  • iPad functions with WiFi hubs in both the 2.4 GHz and 5 GHz ranges.  *(See Footnotes for more details)
  • Can run for a whole 8-hour work day.  The battery life claimed by Apple has been reported to be regularly achieved in real use by many product reviewers.

Working with Groups (2 or more total people):

  • Excellent monitor allows more people to see at one time. Sitting flat on a table, it allows viewing in a full circle.  If the group is standing, it is easily held where all can see.
  • Touch interface removes need for designated mouse/keyboard “driver” when working in a group. Anyone can reach in and touch the screen at any time to do things.
  • The iPad is easier to hold for a standing group. It is lighter and No Juggling Act is required to hold and operate it for a standing group. A laptop must be balanced carefully while touching trackpads and typing on keys while still showing results to a group.
  • The Work experience is more open. It is more like sharing a magazine or pad of paper than a laptop. More people at one time are included.  The work experience is more approachable, inviting greater participation. (Although the novelty of the iPad might be distracting until people are accustomed to it.)
  • The iPad’s speakers can reach a decent volume level to play sound to a group. (While it is rather easy to accidentally cover them with a hand, it is easy to direct the sound with a hand as well.)

Investment:

  • While $499 is a bit more expensive than some netbooks, it is not out of the ballpark.  And it can still be less than many laptops.
  • Since there is no contract or subsidized pricing, replacement cost is never more than the original cost. (Assuming it is purchased through normal retail channels. Might not be true in other countries or if purchased through data providers. If in doubt, check before purchasing.)
  • For 3G data models:
    • the $130 extra can be justified for the GPS alone. It is just a bit more than the cost of an external GPS device.
    • Data plans do not require contracts.  They are pre-paid month-to-month service. (Assumes a retail purchase through Apple channels. This may not be true outside the United States or if you purchase it through a subsidized plan from a data provider.)
  • Third-party repair centers are already acquiring replacement glass for less-expensive repairs than Apple stores.
  • The standard license agreement provided by Apple allows a single purchase to be used on up to 5 devices if those devices are synchronized to one account on one computer.  (Some software can have a non-standard license, and I am not a lawyer.  You should check the licenses for yourself.)
  • Applications delivered through the App Store are generally priced more affordably than store-purchased applications.
  • Apps can be purchased which will work on iPhone, iPod Touch and iPad.   Forward compatibility has been very good and upgrades are typically free.
  • Competition among developers is very high.  The cost to enter the market and begin selling is very low, so companies potentially have more time to spend on improving products or making new ones.

Footnotes:

* WiFi

  • The WiFi frequencies listed are under U.S. FCC rules. Allowed frequencies are probably different in other countries.
  • Reports of unexpectedly short WiFi range have surfaced. I have read no reports of 3G reception issues.  Some steps have been noted that improve the range.
  • News reports have surfaced of problems taking U.S. iPads to other countries due to different wireless frequency rules. Check with proper authorities if traveling with iPad.)

** Electronics in a ZipLock Bag (use these tips at your own risk)

  • Of course if you are using the ZipLock bag tip, you should pick your bag carefully.  Very thin bags tear very easily. Thicker, more industrial-strength bags can be found in the hardware section of stores or home-supply stores.
  • Note also that if you attempt to use a electronic device in conditions that will make it cold, (or just colder than the air) then you should not remove it from the bag until it warms up.  When you expose the device, water in the air can condense freely in and on the device.  This can damage or destroy your device.
    • I tried this trick on a recent trip to the Florida keys with my cheap digital camera.  We were snorkeling in very warm, shallow water and it worked great.  We had photos and videos of everything we saw.  Until someone took the camera out of the bag.  Water condensed visibly under the glass of the screen and it quickly stopped working.  The SD card also stopped working.  My computer could not even tell that one had been put in the reader.
    • After drying under a fan overnight, both the camera and card started working.  I was very thankful to have our family pictures back as well as the camera.
    • Some of my clever friends suggested drying the camera and card in a bag of dry rice.  Apparently this is a cheap and available alternative to desiccant.
    • Some of my cleverer friends suggested putting the dry rice into the bag with the camera BEFORE going into cold conditions.
    • I note that I did not go very deep in the water.  I have little doubt that water pressure could easily damage a fragile electronics and their cases. In the case of my camera, I was a bit worried about the motor and gears in the lens that pops out when the camera is on.  The pressure could have forced it backward into the case and stripped the gears.
    • The picture quality was also lowered by the bag.

Tags: , , ,

XCode Problem “expected specifier-qualifier-list before

Solution:  check that you included appropriate frameworks in your project and target.

I had this just now while building a new project and forgot to put the frameworks into the project.

Tags: ,

XCode Giving Incorrect Error Messages after Upgrade to 3.2.2

A few days ago,  I was helping upgrade a Mac’s XCode environment from 3.1.4.   After the upgrade, the first attempt to build and run a project resulted in strange errors.  “Security Policy Violation”  came back from the device along with problems with the entitlements.

After much poking and prodding, I noticed that the Base SDK for the project was set to “iPhone OS 2.0 (missing)”.  The base SDK for the project was no longer available in XCode after the 3.2.2 upgrade.

Resetting the BaseSDK to 3.0 solved the issues and the build and run was fine.

Tags: , ,

Article on iPhone as Gaming Platform

The iPhone Website has an interesting article about how iPhone devices are taking a bigger and bigger percentage of the mobile video game market each year, going from 5% in 2008 to 19% in 2009. The article asks if the readers have given up mobile platforms to consolidate on iPhone devices (which includes iPod Touch and soon iPad.)

It wasn’t a surprise to me to move to gaming on the iPhone after seeing so many others pick up gaming with it.  What surprised me was my son putting down his GameBoy DS and using the iPod Touch almost full time.  He is now able to play new games practically every day (when I approve the games and homework is complete.)  I’ve given him a bit of an allowance to buy some, but he’s going with freebies mostly.

For his birthday, he’s asked for his own iPod Touch and iTunes account so he can get what he wants.  We’ll have to see how the parental controls work out for the account, but he’ll probably get the iPod Touch.

For me, this brought up memories of reading “The Innovator’s Dilemma” by Clayton Christensen (professor of Harvard Business school.)  The “disruptive technologies” always start out small and ignored by the leading firms in the field. It also starts out as being less than the main customers need or want, but grows quickly into the space where the customer feels it is “good enough”.

I think iPhone fits the bill.

Tags: , , , ,

Amazon e-Book share to fall from 90% to 35%, Analyst Says

Thoughts started by Wall Street Journal’s blogger Matt Phillips’ article.

Always interesting to try and predict what the future holds… My opinion: eBooks will be BIG. Now why?(disclosure: I am an iPhone developer. I gave my science-teacher wife a Kindle for her birthday.)

Have we any reason to think that paper prices won’t keep increasing? Aren’t paper prices heavily influenced by energy prices, labor prices and plain old demand? (Retail price of 1 sheet of cheap copy paper is nearing 1 cent in my area.) Just the raw paper material and shipping it around will make it more expensive.

Isn’t much of the book industry basically an impulse-driven market? eBooks are fantastic for such a market. The trivial shipping costs of internet data may it easy to give away free sample chapters and give instant gratification to buyers. People who Read the rest of this entry »

Tags: , ,

iPhone Ad-Hoc distribution problems

Well,  an interesting bit of problem-solving today.

I sent a revision of an app to a client with ad-hoc distribution.  It installed just fine on one device, but would not install on the other. (The one that was going to be used to demo the product.) I double-checked that both device IDs were properly included in the provisioning profile.

After some quick re-reading, I thought the (cryptic) error might be that I forgot to send the .mobileprovision file along with the app.  One of the instruction lists showed installing the profile manually.  But when the file was emailed and isntalled, iTunes asked if it should replace the existing provisioning profile. It probably came from the app (which has a embedded.mobileprovision file in it.)

iTunes doesn’t show any information about installed profiles (that I could find) so it wasn’t clear if the provisioning profile was actually on the device.  A quick download of the iPhone Configuration Utility cleared that up.  It showed information similar to  XCode’s organizer, including the provisioning profile.

As it turns out, you can’t just send a .zip of your app straight to a Windows computer like you can on the Mac.   I haven’t seen an explanation anywhere, but it might be that the bundle contains files or folders with names that are not Windows-friendly.  Both contain a symlink file, but they seem the same.

The solution it seems is to process the app bundle into an .ipa file.  The easiest way to do this is to drop the bundle on iTunes. It will process the bundle into an ipa file.  Just control-click on the app to pull up the contextual menu and choose “Show in Finder”.   (Or go find it in the iTunes folder.)  Send that ipa file to your ad-hoc Windows users and they can drop it into their iTunes.

The errors from the iPhone log:

unknown mobile_installationd[1347] <Error>: 00808a00 install_embedded_profile: Skipping the installation of the embedded profile
unknown mobile_installationd[1347] <Error>: unrecognized status -67068 from codesigning library
unknown mobile_installationd[1347] <Error>: 00808a00 verify_executable: Could not validate signature: e8008001
unknown mobile_installationd[1347] <Error>: 00808a00 preflight_application_install: Could not verify /var/tmp/install_staging.Pav7Nw/foo_extracted/Payload/appname.app/appname
unknown mobile_installationd[1347] <Error>: 00808a00 install_application: Could not preflight application install
unknown mobile_installation_proxy[1346] <Error>: handle_install: Installation failed
unknown mobile_installationd[1347] <Error>: 00808a00 handle_install: API failed
unknown mobile_installationd[1347] <Error>: 00808a00 send_message: failed to send mach message of 64 bytes: 10000003
unknown mobile_installationd[1347] <Error>: 00808a00 send_error: Could not send error response to client

Tags: , ,

SQLite Missing Functions in iPhone 2.x

While trying to improve my app’s memory usage, I tried to add a call to SQLite’s routine to release memory cache: sqlite3_release_memory().   But when I tried to build it, I got the following error:

ErrorDot“_sqlite3_release_memory”, referenced from:
-[AppDelegate applicationDidReceiveMemoryWarning:] in AppDelegate.o
symbol(s) not found
collect2: ld returned 1 exit status

Read the rest of this entry »

Tags: ,

Mysterious iPhone status bar icon?

Last night I was attending the iPhone SIG of the Florida Macintosh Users Group (FLMUG).

One of the members was asking about an icon in his status bar he couldn’t identify.  It looked like a landline telephone’s receiver with a keyboard underneath.  We scratched our heads for a minute until Phil said “wait, that’s gotta be the TTY setting”.  He quickly looked in Settings under “Phone” and yes, the TTY setting was on.  The icon went away when the setting was turned off.

Kudos to Phil for deducing the answer based on the “phone” and “keyboard” clues.

So today, I had to go lookup the other icons which may be displayed, just in case. 🙂  They are listed by Apple as “status icons” here: http://support.apple.com/kb/HT1558

Walt

Tags: ,