Xcode 5.0.1 git merge to master -> failed because of conflicts

I keep encountering the same issues here,  git refuses to merge based on conflicts with files existing or in use. Especially when a CocoaPods is added, and a new workspace exists where it didn’t in the initial master.

CocoaPods allow you to add modules to a project with ease. It uses features of Xcode that have existed for a while, and a LOT of libraries are available.

I wanted to shout out a solution that is easy enough, but some developers may find they are in.

This applies to any project where you decide to add CocoaPods. Or a workspace of any kind for that matter that was git controlled.

Don’t annex your git repository and start over. Instead follow these few simple steps. The summary should gain your interest enough to do the steps!

A. You created a project with git, branched it, added a workspace with Pods and projects.
B. You want to merge back to master, but Xcode 5.0.1 refuses.
C. Switch to master, close – do not re-save. Then open the project not the workspace.
D. Now Merge from your branch back into master that you are in.
E. Re-open the workspace and work with new master.

Step by Step;
1. You created an Xcode project without a workspace initially with git support.

2. You add code, and eventually add a new branch to it so you can add CocoaPods module to it. Like AFNetworking.  You do a new branch so it can be worked with and tested till it looks good to merge back to master.  **Be sure at some point to add to git the Pods project and/or any sub projects to the source control.

At this point doing a Xcode ‘git’ merge to master fails.  And switching to master and merge doesn’t work entirely as expected.

3.  When you do the CocoaPods, it adds everything to a new Workspace, not the project. This is actually a good thing. If you’re new to working with workspaces, it actually helps a lot.

4. Now you have a workspace in the project.  But if you try to merge your branch back to the ‘master’, it will fail because of conflicts.

5. So switch back to ‘master’ branch.

6. Xcode will ask if you should re-save, or close.  CLICK CLOSE! Remember that the workspace didn’t exist in the ‘master’ source tree.

7. Reopen the project, not the workspace. This is because that is the original state of the project, no workspace existed.

8. Consider adding a tag on your master so you can revert to a prior state.  Tag’s let you mark certain check in points so you can easy move between them.  Xcode doesn’t support tagging yet. So use command line.  **Also remember tags have to be pushed to your repository.

9. Merge from your new branch back over master.  The conflict manager will open, you can choose what to do from here.

10. Close the project, and re-open the workspace, Now master has the correct Workspace properties with all the CocoaPods.

You are now ready for working again and git is all happy with merged ‘master’ from your branch.

Push your local git to the remote if you have one!

Easy Peasy! Thanks for reading!

- Bill Thompson (eSpecialized)

All my Apps and Games on iTunes App Store

Tutorial: Networking and Bonjour on iPhone – Updates Chatty

Working with Chatty 2013 – updated for 2013

Chatty is a great way to learn Networking CFNetwork + Bonjour on the iPhone.  Concepts introduced include Server and Client.  Chat rooms, and how this could be presented on the iPhone. You can find the tutorial here, the updated project is here on github.com.

The program flow looks like this using MindNode Pro.  This App is an easy concept to grasp once you map it out.

Mind Node of Chatty App

Mind Node of Chatty App

Picking the app apart a little bit more;

Server components;
LocalRoom.m inherited from Room.m, uses Server.m.  In Server.m we have two parts.  Creating the Server on the local network, and publishing the service with bonjour (NSNetService).
Managed for us are; Socket, CallBack, Binding to the end point, Run loop integration of the CFNetwork components.

LocalRoom.m uses Connection.m to create the connection between the two systems using CFNetwork.  The local room is the ‘server’ in this instance.  Server publishes and has the listening port. Connection.m manages the actual connection.  LocalRoom.m interacts with both Connection.m/Server.m which is then used by the ChatRoomViewController.m

Chatty Server

This all gets tied together through those ‘room delegates’ and the primary ChattyViewController.m which then sends and displays the messages on screen.

The client connection is similar, I’ll leave that for you to explore.

CFNetwork caveats:
CFNetwork streams are created one way.  This is a connection from one device to another and goes either in sending mode, or receiving mode.  So just remember, two connections need to be managed for each actual pair of devices to make a full duplex (bidirectional) connection.

Why a buffer?
Without a buffer, data has a tendency to get lost. This is common for any kind of communications including voice, visual, ftp, http, old RS232 modems.  No buffer = lost data = retransmission.  Typically programs cannot deal with single bytes of data at a time and still run full speed, so chunks get read and processed instead.

Connection.m handles all the work of setting up the streams, buffering, reading and writing, managing disconnects and problems with resolving dns addresses.  A lot of things can be improved here such as adding GCD to reading/writing to avoid app hangs etc.  The author of the chatty program also has a puzzle.txt file in the project to read for challenges.


GKSession iPhone/iOS device network connecting


After pouring over the documentation at Apple here, and just 2 hours. I was able to implement the GKSession as a GKSessionServer in a viewcontroller.  My implementation was very simplistic. Basically one device starts up a server with a button. Another starts up a client and a update task every second looking for servers.

GKSession was not altogether hard to implement surprisingly.  There are a few design things to take note of;

1. Have a TableView of all the available sessions that are available to make it easy for a user to select from the available connections.

2. setDataReceiveHandler to self. And implements the receiveData handler method.

3. Keep track of peerID’s to peerNames in a dictionary.

4. When starting up the client or server, do these;

_session = [[GKSession alloc] initWithSessionID:nil displayName:self.gcaliasTF.text sessionMode:GKSessionModeServer];

[_session setDataReceiveHandler:self withContext:nil];
[_session setAvailable:YES];


5.  Set available to NO when all connections are made.

6. Search for available connections like this

 NSArray *allPeers= [_session peersWithConnectionState:GKPeerStateAvailable];
    if (allPeers.count>0)
        //update tableview with found available connections

Zoom Cable modem Woes – solved

So this morning, Accuweather, Wunderground, and most internet sites are hit or miss as far as loading under 1 minute or completing the load at all.  Large sites like google.com and facebook even have large delays, up to 2 and 3 minutes or never loading all content.

So this has been going on for a while. Its intermittent at best.  I’ve been wondering if its my Internet provider,  I’m hopeful it isn’t.  XBOX360 gaming has been mostly good to me, but you know, its no good to have one good/one bad aspect to internet.  Ie good gaming, but not good web browsing.

I have a Zoom 5350 cable modem, it works better than the internet providers cable modem as far as staying connected.

So let me list the number of items I’ve gone through to have good internet in the past two years;

1. Poor connections on the cable.  Basically some of these can come loose due to heat, you need to keep them tight.

2. Cables that had gone bad due to being smacked with a hammer, to sharp a turn, or cut, stepped on etc.  Yes those cables are extremely sensitive to being damaged in any way shape or form.

3. Faulty ground to our power box,  basically it had a high resistance, and needed to be redone, so we redid the ground to the house ground properly. This changed everything drastically for the cable modem, and our TV’s. (HD DVR)

4. Splitters – We had a straight through splitter to give the cable modem Full signal, while a -9.6db loss on the other leg. So thus here goes my story.

(Thanks to my Dad for #1,2,3, he’s a retired electrician)

The zoom 5350 cable modem does not like full signal.  I tried a splitter with -3.6db/-3.6db per leg, it still had to much signal to much of the time. So most internet web browsing is hit or miss, or I have to hit reload often to get a website to come up and display. I often hit “Stop”.

I changed the splitter back to the full signal 0.0db/-9.6db.  0.0db is going to a four way split to the TV’s now, that delivers -6db to each tv, and the -9.6db goes to the cable modem. Why not try?  I hadn’t done this before.

Now all those websites load instantly, google is working great. And look at the connection status;


So if you were wondering before about “Does it matter if my zoom cable modem has locked download channels?” and the ISP doesn’t know. The answer is “YES” it makes all the difference to internet browsing.   Persistent connections (video streaming on Youtube) seemed fine, but I am curious to see how this affects gaming.  More for tomorrows testing :)

So does a zoom cable modem without a locked download channel “Not Locked” cause problems? Yes.

The answer probably is in the manual,  as most people say RFM or call tech support.  The ISP only knows the brand of modem they have.

I originally got the ZOOM modem, because our Internet was so terrible with the ISP Provided cable modem. It turns out that it wasn’t that cable modem, it was my cabling, lack of ground, and poor connections and cable inside the home I have.   The other part was operator error (me) adding to our cable system.

What kind of splitters does my Cable provider use?  Extreme brand.  And yes those are the only ones that seem to work well. I have a pile of other splitters and crap cables now!

-William Thompson

Willy Nilly, Inc.



Lenovo Ideapad Y480 Battery Not charging

At first my wife and I thought the battery wouldn’t charge due to faulty hardware.  We were set to take it back since the battery says “Not Charging” and is at 50% in windows when plugged in.  The laptop would run on battery, and also run without battery on the power brick. So these two items were “good” apparently….

It turns out that the Lenovo Idea Pad has a small battery app, and it can be configured to Fully Charge the battery when plugged in, or protect the battery, and it will only charge the battery when it is below a threshold value.  You may be thinking this is not good, but it really is. So the new Lenovo’s are designed to save the battery, this means in two years the battery should be as good as it was when bought (sans the 10% capacity loss per year).  Most laptops I’ve had experience owning, even the RC equipment with Lithium batteries, the batteries bulge, burn up, have no capacity etc. This is usually due to faulty charging algorithms.

First, find the orange icon in your icon tray;

it is orange (it can be a bicycle, a car etc)


Then look for the settings (circled in red)

Now change it to “Fully Charge” Mode

Thanks to microsofts “snipping tool” so I could capture the screen shots, and add some circles!

I really like this laptop so far, about all the reviews I’ve read about it so far complain about the display. For the price we got it at, I can’t complain.

Upgrade Ram on iMac or Run Optimizer?

I’m not getting anything for mentioning these programs. Your experience may vary with them.

Last week I ordered some Additional Ram for our iMac 8 Gigs.  I run Lion in 64 bit mode because that gives me nearly an extra gig of ram (the full 4 gigs) to use.

The Windows PC first;
Now on the PC before I re-installed windows as 64 bit I had tried for weeks to avoid it.  I downloaded Advanced System Optimizer, I bought it, ran it a few times. It did help somewhat with making it “feel” faster.  I even downloaded on the PC Cache Man XP, and other utilities.  Cache man I uninstalled.

ASO Advanced System Optimizer for Windows -> yes it does help windows Performance feel faster.  The largest speed increase came from using Ready Boost on a USB 8 Gig stick!   This speed increase is noticeable in how Windows Redraws its desktop icons when something changes on the system.  The USB Cache made this nearly instantaneous!

So ASO is a Yes! Though only marginal upgrades to the feel of speed. Some had to do with installed services, I think the rest for Windows 7 had to do with running 32 bit mode and being cramped into 3.12 GB of ram out of 4! The re-install to Windows 7 64Bit made a huge difference! Of course everyone experiences this, it feels faster at first, and then over time it seems to bog down.

I have obtained an un-installer for windows, which should help with removing software that bogs down the system coming up in the next 3 months. We shall see! I plan a memory upgrade there too!

Back to the iMac;
On the iMac (its a 2 year old model) I obtained “Mac Keeper” last week. I decided to purchase it because the iMac became dismally slow this year with a recent upgrade to Lion, running Skype, Xcode, Firefox, Thunderbird, and tons of other apps that are memory hungry at the same time, I noticed lots of slow down.

“Mac Keeper” helped with some of it, un-installs of unused software helped with getting rid of the rest.  The iMac felt better daily. Still running Skype and Xcode together its slow.

With a 8 GB ram upgrade just 56$ including shipping, and its Kingston Ram! Wow!  Good timing.

That’s now installed.  The good news is it added with the 4 Gigs, because there are 4 memory slots, I just slide these in, and it all is working together so far (I come from a generation of “DON’T MIX RAM” including across brands etc.).

What remains to be seen is how well it performs here on out.

Mac Keeper = Yes worth it, for those who cannot afford the ram, or don’t have the system to support it!

(ASO) Advanced System Optimizer for Windows = Yes, helps clean up old software that doesn’t need to be on the system, helps unbog the system in services if they are running for no reason.

Ram Upgrade = Definitely YES if you can do it, you should!  Don’t overestimate that just Adding Ram will make a system faster, sometimes you have to clean up, and sometimes only a re-install will do it!  And finally, sometimes its bloat ware! Things get bigger with time, Look at Windows XP.  10 Years adds a LOT of size to the OS.

The big guns;  Also nothing beats going in with a fine tooth comb and removing things that are unneeded yourself.  A self optimization is sometimes necessary, not everyone is capable of this, and if you don’t KNOW what your DOING! DON’T DO IT!  Self optimizations like removing unnecessary programs with their un-installer or a good un-installer program may be in order.  I used Mac Keeper and ASO due to time constraints between projects, and really these companies make it their Duty to ensure a system is stable after optimization. Don’t underestimate the geeks hard at work for you with these programs!  They’ve tested out the best options for stability and ensured a working order machine after the fact!

Windows Common Tools -> Disk cleanup -> yup use it!  Check Disk is also important.  SFC /scannow is too!

Mac -> Disk Check and backup (Time machine).  its a unix os, so don’t forget run levels, services, and things of those nature at the command line.

CloneZilla -> honorable mention!

Keeping an Eye on things;
I have mixed RAM on the iMac, but each bank has its own Matched RAM, so long as only bank switching occurs and the memory controller can deal with it, everything will work fine! NO issues. If I have issues look forward to another post about this in another week. No post = no problems!

Ram type = DDR3-1066.  Originally installed = 4 Gigs DDR3-1066 in slots 1/2,  Added 8 Gigs DDR4-1066 in slots3/4

- eSpecialized


How to use Objective C properties Properly

In programming for iOS devices, many many people get properties wrong.  It is true, there are many ways to use them.

The retain property is probably the best example I can think of.  Some objects when alloc’d and init’d, create a retained object.  Some other + functions create autorelease objects in the iOS library.  I still have problems with these at times, due to the learning curve, and finding other peoples library’s do not follow the same conventions or template that the iOS libraries do.

#import <Foundation/Foundation.h>
@interface Properties : NSObject {
NSMutableArray *myArray; //optional, properties now create the class object from the synthesize statement in xcode 4 and later.
@property (nonatomic, retain) NSMutableArray *myArray;
#import "Properties.h"
@implementation Properties
@synthesize myArray;
self = [super init];
if (self) {
//here we assign the class object myArray the new alloc/init'd instance.  This alloc/init'd instance comes with a retain value of 1
myArray = [[NSMutableArray alloc] init];
return self;
//here we use the accessors to release the contents.
self.myArray = nil;
[super dealloc];

And that my friends is how to use a retain property.  If you set it = to anything else,  use the class object if what is returned is already retained (mutablecopy, copy, alloc/init).  If what you use is autoreleased (+ methods),  use the self.myArray to obtain the object and set a retain value on it.

I realize I don’t show assign for objects or others. Assigns you can always use the accessor methods, you must retain or release objects as needed with assigns and watch them just as tho you were using a class object.

If your App Delegate has your music, sound effects, graphics, opengl context etc retained. All subclasses (main menu, game, prefs etc) should only reference those retained objects with an assign.

Specifying autorelease;
You can change a retained object into an autorelease object. Once all objects no longer retain it, it is dealloc’d.
1. Do not add an object to a autorelease pool twice.
a. Any object that comes from foundation which has a +shared by it, returns an autoreleased object. Read the documentation to ensure this is the case. Adding such an object to autorelease pool will introduce bugs and cause untraceable crashes.
b. For libraries made by other people, double check their code if its available, sometimes people do not return an autorelease object for their +shared methods.

2. Do not set a property that is retained, self.myarray = to a [[NSArray allc] init] retain]; this will result in improper retain counts. Count those retains, one by the property, one from alloc/init, and an additional one at the end with retain. 3 retains there.

I hope this helps you out, always use leak detector AND analyzer to help flush out bugs introduced using properties, and your retain counts.  Hold down on the Run button, and you will get profile and analyze.  Run analyzer first to fix the code problems directly,  and then use profiler to get extra retain bugs you missed.


RFC: Daylight Savings Time – for all integrated devices

Subject Matter: All clocks, computers, portable devices, cell phones, at current time devices require firmware updates if supported to have new dates for day light savings time adjustments.
It would be far easier for all new designs to incorporate the ability to adjust the Day light savings time fall back, spring forward dates.

At current I have a few devices that cannot be updated, and have no interface to do so. At least 2 more sophisticated devices that run off nuclear decay time, and their date systems are hard set.

So I am throwing this out there, if you plan on releasing a device designed with any kind of real time clock (RTC) that has DST support in it, ensure to allow adjusting the dates for fall back, spring forward.

It would be far easier to just allow the consumer to adjust the hour + or – by one hour, than to include a DST setting.

My home thermostat has a old DST setting in it. No interface is included either by menu, or usb to update the device. It is quickly becoming obsolete.

bCandied and SudokuGeek updates

Unfortunately, its been difficult to work on updates right after my surgery. I am in high hopes that this may fix my sinus issues.

Besides all those things.. I believe that the bCandied update is ready at last to go out. I had to re-port half the updates to ensure no bugs appeared. I got the most important ones done for now.

SudokuGeek -> making it harder. Now this may be a challenge. I think I have a way figured out of inserting xwings, triplets, twins, into the puzzles to make a “Very Difficult” category.

Getting back to the Robot >> wow when I cracked open the code to work on it, I found I was a bit muddy minded to work on it. I have a new AVR32 bit controller, and a Venus GPS module. I will build the RC Rover into my Traxxas Summit. Now that should be an excellent robot rover! All terrain, way point capable. I’ll be writing it entirely in C if any one asks. Assembler resources for the AVR32 MCU’s is limited.

Sparky Bot

I’ve been working on some extra after hours project; Sparky Bot.

Before I realized it I was wanting to develop the bot into a mini sumo bot. I lost focus on my vision of just getting the bot to move around and dance.  Its neat how hobby’s change and morph with desire to do more.

The idea of some competition, of building my own sumo ring, and of forming both robot chassis’s into sumo bots won’t be forgotten any time soon. Still I had a task to finish, and here are my results;

1. Finish the bot build I had begun a long time ago.
2. Get the robot to move around, sort of like a dance,  as much as a wheeled robot could be made to do so.
3. All code to be made in Assembler for the AVR
4. Movement would utilize counts from the quadrature encoders. The counts would use two interrupt pins as input to count up a distance.

After much pouring over documentation, assembler how-to and work. I came up with a working robot that does just these tasks.  My list is far longer but this is a good checkpoint before I make improvements.

Image Showing the AVR Mega32

Image Showing the AVR Mega32

Right Profile

Right Profile


Left Profile


Future of the design;
1. Get weight limit to within 500 grams for the sumo bot competition.
2. The servo wheels are a little too wide at the moment, I need to put the servo’s on the inside of the bot to meet the 10CM width and length of the bot.
3. The back with the caster wheel has to change in length to fit the 10 CM length limit.
So this all means that the batteries have to be repositioned. The servo’s instead of mounting on the outside, have to be on the inside. The batteries will have to fit above the servo’s.
Additional parts needed to add are the line detectors so the bot won’t roll off the table.

Lessons learned;
Controlling servo’s is nothing simple or easy, but requires thinking about what is really happening with the timers and when/how to adjust the PWM out to them in the AVR.

The “center” no roll setting for these continuous rotation servo (aka Gear boxes) floats. So the bot will have to be smart about it, and that requires some extra coding.  Since the quadrature encoders have a direction output, I can utilize that to make adjustments on the fly to the standing still code, to ensure the robot stays stationary.

Finally roll speed, the speed needs to be equal on both sides to more or less move in a straight line. Some extra code for this will be needed too.

Finally the movie;


iOS Dev, Reviews, New Apps, Release info and more.

eSpecialized's Developer Blog is using WP-Gravatar

Performance Optimization WordPress Plugins by W3 EDGE

Page optimized by WP Minify WordPress Plugin