Showing posts with label bugs. Show all posts
Showing posts with label bugs. Show all posts

Friday, January 09, 2009

iPhone: Development provisioning profiles and the Entitlements file


I found what appears to be a disconnect between Apple's provisioning documentation and what actually goes on in Xcode. If you want to build your project for development (testing) on your own device, the documentation says to select the top-level build target of your application, open the Info window, click the Build tab, and set "Code Signing Identity" -> "Any iPhone OS" to be "iPhone Developer: YourFirstName YourLastName". (Presumably you must enter your name exactly as it appears on the Team page of your developer portal.) That part works fine. Next, according to the documentation, you should set "Code Signing Provisioning Profile" to be the provisioning profile you created for your combination of name/device/application. When I go to my XCode, there is no such entry!

Instead, just above "Code Signing Identity" is an entry called "Code Signing Entitlements". What I had to do is create a new property list file in my project called Entitlements.plist. The contents of that file look like this:



Where the application-identifier is the exact App ID from your developer portal, including the 10-character prefix. And then back in the Info window, set the value of "Code Signing Entitlements" to simply be "Entitlements.plist". Drag and drop the provisioning profile onto the XCode Organizer, if you haven't already. Now you can build and push the app to your iPhone.

Monday, January 05, 2009

Two Desktop icons in Open File sidebar


I recently had a problem similar to this one:

Fix multiple ghost aliases in the Finder's sidebar

I had two Desktop icons in the sidebar of my Open File dialog boxes, in all of my applications. I had only one Desktop icon in the sidebar of my Finder, though. The advice on that page is good advice, but you don't have to trash the sidebarlists.plist file. Instead you can edit it with the Property List Editor, and under "useritems" you'll find the duplicate entries that are giving you grief. Delete one of them, save it, and then - this is key - logout and log back in.



Thursday, October 11, 2007

MacBook Pro screen, psychedelic colors


This week, I experienced exactly this problem:

http://discussions.apple.com/thread.jspa?threadID=1065874&tstart=0

At first I was sure it was a hardware problem, because it affected the screen both in OS X and when I booted to XP with Boot Camp. I knew the video card was okay, because my external monitor looked fine, but I thought it could be a problem with the laptop LCD, or with the ribbon cable.

But I deleted ~/Library/Preferences/com.apple.universalaccess.plist, just like the last poster said in that thread. Then I did a complete shutdown of the laptop (not a warm boot) and when it came back, it was fine.

Weird.

If you delete com.apple.universalaccess.plist, you will lose any custom keyboard shortcuts you may have defined, but then you can re-create them. Small price to pay.

Saturday, September 30, 2006

VBScript == teh SuxOrz


VBScript sucks in so many - oh, so many! - ways.

The interaction between VBScript and ADO is particularly non-intuitive and bug-ridden. Let me make a note of this one in particular, before I push it down into the part of my brain where it will become just another mote swirling around with all of the other instances of VBScript sucktitude in my memory.

Sometimes you want to know if a field of a database record is NULL, because some VBScript functions like Replace() will choke if you pass them a NULL field. This does not work:


for objField in rsQ.Fields
  if IsNull(objField.Value) then
    strValues = strValues & "NULL,"
  else
    strValues = strValues & "'" & Replace(objField.Value, "'", "''") & "',"
  end if
next
ASP will crash out saying "invalid use of Null: Replace()" even though the value passed the IsNull() check. This, however, works fine:


for objField in rsQ.Fields
  scratchVal = objField.Value
  if IsNull(scratchVal) then
    strValues = strValues & "NULL,"
  else
    strValues = strValues & "'" & Replace(scratchVal, "'", "''") & "',"
  end if
next
One of the nicest projects I ever inherited was from a guy who had done a site in "old" ASP (pre-dotNet) but he did all of the scripting in server-side JScript. It helped that he was a good programmer, but with JScript you spend less time fighting the language. Unfortunately, you can only combine VBScript and JScript under some narrow conditions, so if you inherit a site already done with VBScript you can't just start writing all of your changes in JScript. Even if you fit inside those narrow conditions at the beginning, you'll probably very quickly reach a point where you need to include some JScript into VBScript at a very specific point or vice versa, and the necessary ordering of the code just isn't going to work out.

What you can do that's better yet is to start a gradual migration to ASP.NET, using this really great trick for sharing session state between ASP and ASP.NET on the same server.