- Everything in your life was fine and then one day when you decided to Archive your Xcode build as usual ... BAM! ... out of the blue, the end result turned out to be weird / different one than usual.
-
It almost seems wrong and on closer inspection you can surely tell that what used to work
- had the archive type "ios app archive"
- whereas the newer strange build results has the archive type "generic xcode archive"
- The reason this is happening is because you've added a new framework(s) for which you need to edit the Target > Build Settings and set the Skip Install setting to Yes. Afterwards the "Archive" process will start producing normal end results again.
Wednesday, March 28, 2012
Wrong Archive - "ios app archive" vs "generic xcode archive"
Labels:
generic xcode archive,
incorrect,
ios app archive,
wrong,
xcode
Monday, March 26, 2012
How to combine: IrisCouch to CouchCocoa to RestKit to CoreData to TouchDB?
- MagicalRecord has good reputation as a framework that further abstracts CoreData goodness. So when thinking about the "RestKit to CoreData" piece, it is only natural to get excited about news like: RestKit is built, in part, on top of MagicalRecord !!!
-
CoreData is desirable because of classes like NSFetchedResultsController.h which help to efficiently manage the results returned from a Core Data fetch request. Have a look at the comments for that class and it makes its own usefulness painfully apparent.
- Now CoreData is built upon DataSources such as SQL-lite so I feel that there is an inherent difference in the query language of CoreData which has been written for relational databases versus nosql DBs like CouchDB … but I could be wrong about this and need to collect the opinions of others in the dev community on this matter.
-
If all I'm worried about is the smoothness with which a UITableView updates when used solely against an embedded CouchMobile/TouchDB/SyncPoint instance then I should get and see what it the user experience for the GrocerySync app feels like.
- Look at CouchUITableSource
- Based on https://github.com/couchbaselabs/TouchDB-iOS/wiki/FAQ:
- Couchbase Mobile 2.0 is implemented in an interpreted language (Erlang) whose runtime library needs to be bundled in. This make me think that IF CouchCocoa is the client interfacing with it then CouchUITableSource ends up helping out the same way as NSFetchedResultsController.
- TouchDB is inherently different because it’s using SQL for storage, rather than a custom append-only B-tree implementation. Does this mean that it far better suited for a head on CoreData integration + optimization? *Shrug* ... anyway CouchUITableSource is still there to help for now.
Upgrade from Xcode 4.2 to 4.3
- After installing Xcode 4.3 via the App Store you may feel like you're finished.
- But the process is not yet complete and you'll be surprised if you keep using the Xcode icon in your dock to launch, as there will be no apparent changes to Xcode.
- As pointed out in this blog, the key is to continue the installation process by opening the newer Xcode via Spotlight. Once the additional components installation is finished, you will have the option to uninstall old Xcode installations like 4.2, which you should most definitely make use of!
- Afterwards if you make use of the agvtool, and you run into some problems because of cornercases that the installer does not address ... you could have used instructions from http://doronkatz.com/upgrading-to-xcode-43-and-solving-the-develop ... but they seem to have been taken down :(
- If you are facing problems with MacPorts, then that may be because:
- you need to update to MacPorts 2.0.4
- or even if you've done that, the particular "port install foo" may need to be done via the workaround prescribed here: https://trac.macports.org/wiki/ProblemHotlist
Saturday, March 24, 2012
AuthNet iOS Integration Part 2
There are quite a few gaps in the sample code provided by AuthNet, we will discuss the logs indicating the problem and what chunk of code needs to be added/removed to get to a complete sample that works. This blog entry assumes that you've cleared the challenges of adding AuthNet binaries to your Xcode project. If not then have a peek at AuthNet iOS Integration Part 1 before continuing.
-
Create a header & an implementation class containing the sample code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
// CardProcessingUtils.h @interface CardProcessingUtils : NSObject { NSString *sessionToken; } - (void) loginToGateway; @end This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters// CardProcessingUtils.m #import "CardProcessingUtils.h" #import "AuthNet.h" @implementation CardProcessingUtils ... @end - If you happen to be using PayPal as well as AuthNet in your code then you may run into some syntactical problems. To resolve any such issues, please have a look at this post on stackoverflow.
-
When substituting values in the code, if you provide the "API Login ID" and "Transaction Key" as the name / password values in your call to AuthNet then you will run into the following error as seen in the logs:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
<mobileDeviceLoginResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <messages> <resultCode>Error</resultCode> <message> <code>E00007</code> <text>User authentication failed due to invalid authentication values.</text> </message> </messages> </mobileDeviceLoginResponse> -
This fails as password and transactionKey are distinctly different variables in the header files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
@implementation MerchantAuthenticationType ... @synthesize name; @synthesize transactionKey; @synthesize sessionToken; @synthesize password; @synthesize mobileDeviceId; - So make sure to substitute the sample code with the username and password used with https://developer.authorize.net/ or https://test.authorize.net/
-
If you run the code at this point and end up calling loginToGateway, you will run into the following error logs:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
<mobileDeviceLoginResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <messages> <resultCode>Error</resultCode> <message> <code>E00054</code> <text>The mobile device is not registered with this merchant account.</text> </message> </messages> </mobileDeviceLoginResponse> - This is not the same as being at the point where you simply need to login to the sandbox (https://test.authorize.net/) and enable the new device. No, this is very different and you need to get past this to get to the next point. So you need to add some additional code which is talked about on the forums as well:
-
Now you should be at a point where running the code results in the following error logs:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
<mobileDeviceRegistrationResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <messages> <resultCode>Ok</resultCode> <message> <code>I00005</code> <text>The mobile device has been submitted for approval by the account administrator.</text> </message> </messages> </mobileDeviceRegistrationResponse> - This is more like it! So head over to https://test.authorize.net/ and enable your new device. Here are some screenshots: screenshot_1 and screenshot_2
- Sadly we aren't done yet, we see a message about the mobile device being ready for use but we also notice that the sessionToken has come back as null and therefore the next call's response displays an error ... claiming that the request content was incomplete:
- Even I don't have a solution past this point, feel free to follow this forum thread for any progress on the matter.
AuthNet iOS Integration Part 1
- You can start with the official instructions to get an account with Authorize.Net and download their iOS SDK. Afterwards the instructions are bit out of date, so you can follow along below.
-
After you download and unzip the SDK, you can move the files around to have them structured in this manner:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
$ cd ~/dev/myProject $ clear && tree -L 2 . ├── MyProject/ │ ├── MyProject-Info.plist │ ├── MyProject-Prefix.pch │ ├── MyProject_AppDelegate.h │ ├── MyProject_AppDelegate.m │ └── ... ├── MyProject.xcdatamodeld/ │ └── ... ├── MyProject.xcodeproj/ │ ├── project.pbxproj │ ├── project.xcworkspace/ │ └── xcuserdata/ ├── anet_ios_sdk-1.0.0/ │ ├── ANMobilePaymentLib/ │ ├── ANMobilePaymentLib.xcodeproj │ ├── ANMobilePaymentLib_Prefix.pch │ └── ... └── ... -
The structure above has the following pros:
- Clarity around which version has been downloaded and in use at any point of time: anet_ios_sdk-X.X.X
-
If you work long enough to have multiple versions, then having them in your repository (assumption - GIT repo) helps figure out any migration issues
- $(SRCROOT)/anet_ios_sdk-1.0.0/ANMobilePaymentLib/
- $(SRCROOT)/anet_ios_sdk-1.0.1/ANMobilePaymentLib/
- $(SRCROOT)/anet_ios_sdk-1.0.2/ANMobilePaymentLib/
- ...
- $(SRCROOT)/anet_ios_sdk-X.X.X/ANMobilePaymentLib/
-
Goto MyProject > Targets > Build Settings in Xcode and set:
-
Header Search Paths
- "${SDK_DIR}"/usr/include/libxml2
- Mark the Recursive checkbox as checked
- "$(SRCROOT)/anet_ios_sdk-1.0.0/ANMobilePaymentLib"
- "${SDK_DIR}"/usr/include/libxml2
-
Library Search Paths
- "$(SRCROOT)/anet_ios_sdk-1.0.0/ANMobilePaymentLib"
-
Other Linker Flags
- -lxml2
-
Header Search Paths
-
Drag & Drop the ANMobilePaymentLib.xcodeproj file from a Finder window into Xcode under MyProject.
-
If you don't follow this step then you will face compilation issues like:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
8 total like this - Undefined symbols for architecture i386: "_OBJC_CLASS_$_AuthNet", referenced from: objc-class-ref in MyProject_AppDelegate.o objc-class-ref in CardProcessingUtils.o (maybe you meant: _OBJC_CLASS_$_AuthNetWorkaround) ld: symbol(s) not found for architecture i386
-
If you don't follow this step then you will face compilation issues like:
-
Goto MyProject > Targets > Build Phases in Xcode and set:
-
Link Binary With Libraries
- libANMobilePaymentLib.a
-
Link Binary With Libraries
- For a discussion on the fixes to the sample code, head over to AuthNet iOS Integration Part 2
Wednesday, March 21, 2012
Bamboo Pen Tablet + Mac + InkScape
- First of all this video made all the difference in the world in terms of getting the bamboo tablet device to do what I wanted it to do once I to understand the pen (absolute) mode versus the mouse mode.
Friday, March 9, 2012
Tweeking Lion OSX for Inkscape
- In order to use the keyboard and move around the canvas, you will need to disable the default mapping for the 'ctrl' + 'arrow' keys.
- PageUp and PageDown for bring to front or send to back will be:
- 'fn' + 'up arrow'
- 'fn' + 'down arrow'
Subscribe to:
Posts (Atom)