Skip to content

Repository management of iOS Projects

Some common things to note when using Repository for iOS,Mac projects:

  1. When working as a team , avoid conflict  in .xcodeproj by limiting edits to the project to one team member at a time. If still conflict occurs the only efficient way to resolve is to revert the changes and merge the changes manually.
  2. Ignore the below items from repository
    • .DS_Store
    • *.swp
    • *~.nib
    • build/
    • *.pbxuser
    • *.perspective
    • *.perspectivev3
    • *.project.xcworkspace
    • *.xcuserdata
    • *.mode1v3
    • *.mode2v3
  3. When you use SVN, ignore .git files and when you use GIT ignore .svn files
  4. Always ensure you do not ignore the *.a files until and otherwise you explicitly require it to be ignored

Reference:

http://stackoverflow.com/questions/5343485/what-files-should-svn-ignore-when-doing-iphone-development

http://stackoverflow.com/questions/5931788/iphone-dev-how-important-is-project-pbxproj

The current deployment target does not support automated __weak references

iOS developers will face this error when they start developing with ARC enabled for the first time.

Reason:

This happens because the least version required for using weak keyword is not set in the deployment target of the Target of the project. ARC  is available in iOS 4.0 but weak references are not supported in iOS 4.0 , but from iOS 5.0 weak references are also supported.

Solution:

1. If you do intend to support the versions below 5.0 from iOS 4.0, then use unsafe_unretained instead of weak

2. If you do not want to support the versions below 5.0, then change the Deployment Target in your targets to 5.0 or above.

Notes:

In addition to this there are several classes which can not use weak references:

http://stackoverflow.com/questions/9193445/weak-property-for-delegate-cannot-be-formed

http://developer.apple.com/library/ios/#releasenotes/ObjectiveC/ObjCAvailabilityIndex/_index.html

Ability to set properties using Interface Builder for objects

When we use interface builder, not all of the properties will be configurable for view or a control. With Xcode 4.2 release this problem is solved partially.

Lets  say for example,we add a scroll view and a content view on it. IB is meant for fixing everything we know at compile time. Now if we do know the content size of the scroll view we will prefer to set it. But before Xcode 4.2 it was not possible.

Right from Xcode 4.2, a separate section named User defined runtime attributes are available in IB interface. But the project must conform to below requirements: (Thanks to stackoverflow user)

  • Compiling with iOS 5.0.
  • Setting the .xib version attribute to 4.2
  • Running in a simulator or device with iOS 5.0. Older version won’t work.

Image

For the example I have mentioned, the below details thing can be set:

  • Key Path: contentSize
  • Type: Size
  • Value: {width, height}

I doubt it will support the UIEdgeInsets property through run time property interface. I have not tested it.

SOURCE:

http://stackoverflow.com/questions/1135163/how-do-i-use-uiscrollview-in-interface-builder

Performance tuning with shadow drawing in iOS

Drawing shadows is expensive operation, so for example if your application allows other interface orientation and you start to rotate the device, without specifying explicitly the path of the shadow it has to be rendered several times during that animation which will, depending on the shape, probably visibly slow down the animation .

if your view is going to have rounded corners use bezier path.

http://stackoverflow.com/questions/805872/how-do-i-draw-a-shadow-under-a-uiview

Native App development is here to stay

Native Vs Web

With the Jonnathan Dan’s article , I sense a strong case for the survival of native development.  Earlier when I on discussions with my friends who work in web development , who lead mobile projects and with people on technical forums, most of them were in one voice told that Native Mobile development will die with some shrilling Hybrid approach is best of both the worlds.

I then felt that native mobile development will in future become suitable for a niche market like Games, apps where audio , graphic rendering and where too much dependence with hardware APIs present.  Every other thing can be managed with a Hybrid app and when the brand is established and when we do not have a dependency with Hardware or you get hardware access with HTML5, hybrid approach can also be killed. But reading in to his article gives me a new insight. That is,

Mobile has less space and those who use it are mostly they are busy doing something else either in travel or when they are in break, rushing in to station, chatting with their  girl friend or boy friend and expects  things engage quickly. They do not want to see much of their screen being occupied with loading text  , spinner or  which  behaves clumsily not being coped to our instincts.And as for my experience I have experienced all this with Mobile Web Apps even with 3G (India) connectivity.

Any developer or a brand who wanted to keep their customer loyalty needs to offer their app with the constraint so tough to meet: Not wasting the users’ time.

HTML5 in mobile with Hybrid development or standalone app has not consistently achieved this. And Native has achieved this. But at a bigger cost and a necessity manage lot of developers and lot of code.

So until HTML5 is at its blazing speed, Native is going to stay.

iOS and Bluetooth Communication

Communication to Bluetooth devices was possible with External Accessory Framework by registering in MFI program. But this case was until iOS 5 came with which came the CoreBluetooth Framework. But what is the difference between them?

External Accessory Framework:

1.  To use this framework we need to be registered in MFI Program and should have made our bluetooth enabled device MFI compliant. To register here as such we need not pay for Apple. But there are costs involved in getting a certificate from third parties that your hardware does not interface with iOS device.

2. It is available for  all iOS based devices that run in iOS 3.0 and above.

CoreBluetooth Framework:

1. There is no entry cost, no registration needed.

2. It is used only for devices that are compatible with Bluetooth Low Energy.  (Bluetooth Low Energy is a feature of Bluetooth 4.0  which is claimed to be consuming far less power than that of classis Bluetooth devices)

3. iPhone 4S  is the only supported iOS device that is BLE enabled, so Core Bluetooth Framework based app can at this point in time be supported only in that device.

4.  It is supported only from iOS 5.0.

-[UIImage encodeWithCoder:] unrecognised selector sent to instance ?

Note: The below implementation is valid only if you support versions below iOS 5.0. For iOS 5.0 this problem is fixed by Apple.

If you are planning to archive and unarchive the UImage or UIIMageView , do not forget to implement the initWithCoder and encodeWithCoder methods of UIImage.

If you fail to do so, your app will crash with the error: -[UIImage encodeWithCoder:] unrecognised selector sent to instance.

Why Microsoft wants to behave this way?

Started playing with Web development for the last three months. Initially started with JQuery Mobile Framework to develop applications.

If at all I go for in search for documentation on an HTML element or anything I get some of the below stuff:

Provided by most browsers, but not Internet Explorer

Provided by many browsers, including Internet Explorer.

Why do they behave this way? They can show that they are unique by providing something that others don’t offer to get attention and look unique.(like Apple, Device Orientation support provided only on iOS Browsers) But why is Microsoft has done the other way?

Do they gain anything this way?

Even though the following is nowhere related to Web, I got remembered this quotation of Steve Jobs

“The only problem with Microsoft is they just have no taste. They have absolutely no taste. And I don’t mean that in a small way, I mean that in a big way, in the sense that they don’t think of original ideas, and they don’t bring much culture into their products.”
“I am saddened, not by Microsoft’s success — I have no problem with their success. They’ve earned their success, for the most part. I have a problem with the fact that they just make really third-rate products.”

5 Things CIOs need to know before mobile-enabling

Webinar at Aspire Systems

Join us for a Webinar                                                                         
Theme: 5 things CIOs need to know before mobile-enabling
Date: Thursday, June 2, 2011
Time: 11 AM PST / 2 PM EST

“More than 4 billion people around the world now use cell phones, and for 450 million of those people, the Web is a fully mobile experience,” according to the McKinsey Global Institute. This explosive growth of mobile is having a significant impact on B2C and B2B businesses.

Mobile-enablement, however, is more than just tailoring your website’s content to fit a smaller screen. There are several options and challenges involved in going the mobile route. Executives overseeing mobile initiatives need to be aware of the considerations – in order to get the maximum RoI from their mobile strategy.

Come listen to two experienced practitioners discuss key elements that will be crucial in your mobile strategy, on June 2nd, 2011 at 2 PM EST.

Some areas that will be covered include:

Native mobile apps Vs. Mobile web

Design simplicity: where less is more

Mobile as a new channel for growth

And much more…

Speaker Profiles

William Walsh
Senior Manager – Mobile strategy
Discover Financial Services

William is a pioneer and thought-leader in the wireless industry. He has created and driven development of mobile multimedia applications (now used on 100+ million devices worldwide) including entry into the emerging $13 billion mobile advertising market and $35 billion location based services market.

In his previous role as Mobile Product Manager at Walgreens, he successfully launched Walgreens iPhone, Android, and Blackberry applications. He defined the marketing message for Walgreen’s iPhone application and propelled it to No.3 in the iTunes Lifestyle category – the app also won in 2 categories of the Webby awards.

Vinod K
Mobile Practice Manager
Aspire Systems

Vinod is an IT practitioner for the last 13 years, with over 10 years working in the mobile space. Vinod understands what it takes to go mobile – the challenges, pros and cons of different approaches. He has consulted several Fortune 500 companies and helped them define their mobile roadmap.

Vinod has hands-on experience working on various mobile technologies, right from programming for Palm OS close to 10 years ago, to leading a 20+ member team for a Fortune 500 company in the retail space recently. Vinod led the team working on their iPhone and Android apps (the iphone was subsequently one of the top 5 apps in the iTunes Lifestyle category).

Xcode 4 buggy

How can you make a developer easily frustrated?

When you are asked not to do things, you have to do with a IDE.

Here are things you should not do with Xcode IDE version 4.0.

1. Dont use Command + Z to undo the changes you have made.

2. Dont use Command + C to copy and Command + V to paste.

3. Dont save the changes you are making to a file.

4. Dont use Command + X to cut some of your code.

If you dare to do , you would be notified with a message “”Internal error” asking for you to either crash or continue.

No one wants our IDE to crash, so choose to continue and you try the same operation and Xcode throws you the same message again. If you keep doing many times, Xcode would hang and Crash.

There are other annoying things with this version of Xcode.

1. You can not use debugger once you have started your application in run mode. You can debug only if you start right away debugging.

2. Most of the shortcuts you have used with earlier Xocde and Interface builder will not work.

Hope to add many more things to the above list, in my tryst with Xcode 4.

Follow

Get every new post delivered to your Inbox.