Posts Tagged Xcode

XCode 4 Column-Wise Copy-Paste Changed – Update

By accident today, I found that the built-in application TextEdit still supports column-wise copy-paste operations the way I liked them in old versions of Xcode.

I had copied a column of numbers from Xcode and pasted it into a document assuming that TextEdit would just paste it in linearly and I would fix up the format afterward.

SURPRISE!  It pasted in columnar fashion just like Xcode once did.  It made short work of my editing.

A quick test showed that I can hold the option key and copy in columnar fashion as well.

Neither Xcode nor TextWrangler can paste this way.

TextEdit just got more valuable to me for doing work.

My previous blog post on this matter.

Tags:

Xcode 4.3.2 pains and tips 1

So far, XCode 4.3.2 has been irritating.  It crashes far too often.  But here is some of what I’ve learned:

Get a funny response from copy and paste in Xcode? Strange response from Xcode from undo?  Did the change not appear in Xcode?  Did lines disappear from Xcode?

These kinds of things usually indicate that a crash will be happening soon.

Sometimes I can recover by changing to another file, then changing back. This does seem to help keep Xcode running.

My editing habits probably contributed a little. I tend to scroll around, then use undo-redo in quick succession as a way to go back to where I was in the file.  Usually this was fine in previous versions, but Xcode 4.3.2 seems to crash a lot right after I do this.

 

Tags:

IDE Feature Wish List – Spell Check Comments

More things for the IDE (Integrated Development Environment).  Xcode is the one I use for iPhone development,  so hint, hint Apple.

 Check Spelling Inside Comments
This a useful feature, really.  I often use the TextEdit application that came with my Mac and it will auto-correct while I type.  On average, this is a big plus when my fingers get a little out of order and transpose two letters.
Since the comments are about the written communication from one human developer to other human developers, having spell-check is really important.
See my previous posts that talk about having comments written in RTF so we can communicate with more than plain text.  (Why are we still stuck with plain-text source files in 2012?)

Tags: , ,

IDE Feature Wish List – Comments in Project File

More things for the IDE (Integrated Development Environment).  Xcode is the one I use for iPhone development,  so hint, hint Apple.

Provide space to comment settings provided to the compiler by the IDE.

We can specify compiler macros and such in lots of IDEs. One example is a preprocessor flag named “DEBUG”.  Yet there may be definitions for preprocessor macros that do not explain themselves.  A deliberately bad example may be  ”MAKEOBSCUREOPERATIONSALLOWED”.

If there is a place in your work where you as “why did someone do that?” then you have a need for more information.  And that information should travel with the thing it describes, not in some separate file where it may be lost (or never found).

If there is a slot to make a decision (especially a decision for another file), then there needs to be a slot to record the reason for the decision.

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: , ,

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: , ,

Getting to Build Options in XCode for iPhone Projects

Choose one of the "Base SDK" members.

Choose one of the "Base SDK" members from the "Overview" popup in the project window.

Been frustrated with getting the proper compiler options turned on and off for iPhone projects because they don’t show up in the build settings?  Me Too.

Many thanks to Rick Maddy for posting the answer to this on iPhoneDevSDK.com so I can finally access the “GCC 4.0 – Code Generation” and “GCC 4.0 – Language” sections correctly.

To see these entries in the settings window,  you must first go to the “Overview” popup menu in the project window and select one of the entries that correspond to the “Base SDK” as specified in the build settings.  If your project’s “Base SDK” (wording used by XCode 3.1.3) is a device, you must select one of the device entries.

Note that for XCode version 3.1.2.  this was referred to as  “(Project Setting)”.  If later or previous versions have different wording, please let me know and I’ll update this.

If any other entry from the popup’s “Active SDK” section is chosen, you will not see these through either method of accessing the build options.   This is typically my problem as the selection spends most of the time on a “Simulator” setting during development.

With another entry, you may see some flags show in the “User Defined” section at the bottom of the build options.  You can still set options with these (as I did before finding out this information.)

The "Base SDK" project setting.

The "Base SDK" project setting.

This is just what I needed to address problems like:

“error: ‘for’ loop initial declaration used outside C99 mode”

Tags: ,

I told XCode to forget it, but it can’t

Another XCode bug brought to light thanks to the product “Little Snitch” (mentioned in my phone-home post),  I sometimes see a notice that XCode is trying to connect to the SSH port on an IP address I no longer use.   I can’t make it stop.   I just hope that whoever has the address now doesn’t track me down and send the Feds.  (That would be like worrying about a snowflake in a blizzard I’m sure.)

XCode was once setup to connect to my home IP address to get to the Subversion server I had there.  At a certain point I stopped using that server and started using repositories on my laptop because now I’m often unable to connect back to the house. (And because I wanted to shutoff the massive tower to lower my massive electric bill. )

I removed the IP address from my list of repositories under SCM Preferences, and the address is not listed under the SSH tab in that preference pane either.  A search of the XCode preference file turned up empty.  But somewhere that address is still remembered by XCode.

Tags: , , ,

XCode Crashes if it can’t phone-home

I’ve had trouble lately with XCode crashing immediately after an error trying to communicate with Apple’s servers.

I don’t know quite what’s happening, but i have Little Snitch installed on my Mac and I often work in Starbucks or bookstores where paid WiFi is available.   Somehow, being denied its chat with Apple makes XCode crash.

Little Snitch is a cool piece of software.  I bought it in one of those bundle deals from MacHeist or MacUpdate.  But its alert every time an unexpected communication attempt is made can be quite eye-opening.   However, I learned quickly to not deny XCode when it tries to talk to Apple.  The first time I did that, XCode crashed immediately and took my text changes with it.  (Not much work lost thankfully.)

I still make Little Snitch ask for permission for all XCode communications so I can see when they happen.  If I don’t press the “Allow” button before the attempt times out, XCode may or may not crash. I give permission as fast as possible so it won’t crash.

In the past few days though, XCode has still crashed, even with permission given in under 5 seconds.  I’ve begun to wonder if it might be a problem with router used by stores to get logins before allowing traffic out to the internet.  If XCode is denied at that point, will it still crash?  I don’t know yet.   But since such WiFi spots allow the computer to connect, it may look like you are on the internet when you aren’t.  Communications will fail.

Thankfully, it doesn’t try very frequently.  If it did,  it would be too frustrating to deal with all the crashes.  I also note that the XCode Console output shows a crash report submitted to Apple,  so I assume they don’t need another bug report on it.

Tags: , , ,