iOS 7 wants: Actionable notifications and push interface

iOS 7 wants: Actionable notifications and push interface

By Rene Ritchie

iOS 7 wants: Actionable notifications and push interface

Notification Center debuted in iOS 5 and began transforming Apple’s old, unscalable, modal alert system into something less obtrusive and more robust. Unfortunately, iOS 6 spent so much time setting up the future — kicking Google to the curb, outsourcing social, and improving support for Asia — that notifications were left pretty much at a standstill. Hopefully iOS 7‘s flatter and more consistent redesign won’t occupy the lion’s share of attention this time around, and Notification Center will not only catchup, but leap ahead. And hopefully it’ll start with the transition from informational alerts to actionable ones.

This isn’t a new request by any means. Many people have made it many times,including me last year. Palm had the beginnings of it in webOS, jailbreak apps likeBiteSMS have been doing for ages, and Google started adding it to Android in 2012.

And here’s why — whether we’re tired, busy, or just plain lazy, having to go hunting for apps — even widgets — just to reply to a message, reset a timer, change a song, or do any other trivial activity is outdated and inefficient. It’s pull in the age of push.

It’s well past time for actions, like information, comes to us.

From creation to conversation

In the current version of iOS, if we’re using an app or playing a game or just fiddling around on the Home Screen, and an SMS, iMessage, IM, Hangout, or any other short bit of text is sent our way, we get a roll-down banner notification. If we tap the banner, it rips us from our current activity and sends us carousel-ing into whatever app owns that bit of text. At that point, we have to wait for the host app to wake up, connect, and download the actual message. (Even if all of it was shown in the push notification, the information isn’t passed along and the app has to make its own, post-launch request to get its own, post-launch copy.) Then, after replying, we have to either use the fast app switcher to go back to our previous app, or the old Home button click/icon tap combo. There’s no insta-back button or gesture for that.

Imagine instead that, once the banner notification rolls down, we could not only tap on it to go to the app, but drag it down to get an actionable dialog. Then we could quickly enter and send a response, at which point the dialog would disappear and we could immediately resume what we were doing. No carousel app switching, no need to click and tap our way back.

Apple already does a lot of the out-of-app heavy messaging lifting today, in Share Sheets. Launch the Photos app and pick a photo. Tap the Action button, tap Mail, Messages, or Twitter, and an embedded Mail, Message, or Tweet sheet slides up from the bottom. Type and send a message. The message gets sent and the sheet slides down again, allowing you to continue right where you left off. In fact, Notification Center already has buttons for calling up Twitter and Facebook sheets.

Share Sheets in apps like Photos already let you do quick messaging, just not replies.

The current system only works to create new messages, and only for Apple’s built-in and integrated partner apps (Mail, Messages, Twitter, and Facebook). It’s not impossible, however, to imagine it working for replies as well.

Quick and dirty mockup of share sheets handling replies.

And with third-party messaging apps. At worst, Notification Center could simply keep pulling the icon to identify the app. In a perfect world, those third-party apps could include parameters for/register with with Notification Center to use in presenting their own embedded sheets (similar in spirit to how Passbook provides for some level of design in third-party passes).

Quicker and dirtier mockup of custom, third-party share sheets.

With Notification Center maintaining control of the transactions, communications could be handled more securely and power efficiently as well.

From snooze to choose

The same basic system could also work for changing alarms. Right now, just like with messages, if an alarm goes off, we can either okay it or put it to sleep, but we can’t change it. If we want to do that, we have to mishandle the alert in someway, then go track down the app (typically Clock) to do something about it.

In a push-interface world, the alarm would go off and the banner could be pulled down into, or the popup would already be, a widget that could not only be dismissed or slept, but altered right there and then.

Even if it was kept modal, a timer could be scrubbed back from 00:00 to 00:30, for example, right on the alert.

Quick and dirty mockup of Siri timer widget made scrubbable model notification

Likewise, an alarm could be deferred, but could also be quickly changed to another time.

From switcher to center

Controls are trickier, because they’re persistent rather than event-driven. No one wants a constant banner with audio controls in it, for example, which is probably why Apple annexed them into the fast app switcher in iOS 4.

They might make more sense in Notification Center, however, where instead of being a double-click and horizontal swipe away, they’re just a downward swipe. The brightness and AirPlay controls could easily live there as well, as could all the other settings most people never use, but the nerds among us want faster access to — everything from Wi-Fi to Bluetooth to hotspot to Airplane mode, to the kitchen sync in there as well. They could be set to off by default, so mainstream users aren’t bothered by them, but there and ready to be enabled by those who want them.

Quickest and most dirtiest mockup of controls put into Notification Center

From static to dynamic

As much as we like to compare platforms and talk about who and who isn’t innovating, who’s blazing ahead, who’s copying, and who’s playing catchup, the truth is every major player is mostly just giving us variations on a theme.

Siri, Google Now, and Kinect are starting to break down the old concepts, not just with natural language and gesture-based control schemes, but with dynamically generated, contextually aware interfaces. They’re still new, still experimental, still layers on top of far more static Home screens, apps, and activities, but they’re getting there.

If Apple wants to get really avant guarde, Notification Center could become contextual, presenting information, actions, and options depending on the time of day, our location, and what we’re doing when we invoke it. And, of course, helpfully nudge us with actionable banners when we haven’t invoked it — the classic example being “Traffic has changed, you will now have to leave 10 min. earlier for your meeting, would you like me to message attendees?”

From the Apple II to the Mac, Apple’s been at the forefront of making ever more accessible types of interface mainstream. Actionable notifications could be a piece of the whatever’s-next puzzle, and I hope we see it from Apple sooner rather than later.

If you’ve used webOS notifications, or Jelly Bean notifications, or BiteSMS, or if you’re just tired of switching apps every time you get an alert, let me know what you think — should the future be actionable, and how?

Source : See Here


Foursquare Introduces ‘Super-Specific’ Search And Filter Options For iOS And Android To Help You Find New Venues


As Foursquare evolves, it wants to help you find either new places to check out or lead you to places where your friends have already been. Mixed in with that is recommendation technology to show you places that you might be interested in based on where you’ve been before. Today, Foursquare updated its iOS and Android apps with an advanced search option that lets you control how the service seeks out new venues for you.

In its blog post today, Foursquare “dares” you to get “super specific” with your searches. Basically, the company is saying that they have enough data to find any place that you could imagine. One of the example searches is: “A cheap sushi place that’s nearby and open now, but that I haven’t been to yet.” Again, this is a search performed based on all of the data that Foursquare has collected over the years, but its first move into a more conversational search experience. Companies like Google are jumping on this bandwagon as well.

When you perform a search like the one suggested above, you just get results as you’d normally expect. Foursquare is processing these inquiries surprisingly fast, which means that you’re likely to settle on a place quickly:


The interesting part comes with the new filter options, where you can home in on a venue based on whether you or a friend have checked in before, by price, if the venue has a special or if you’ve saved it to check out later:



With these dynamic search and filter options, Foursquare has made the jump to become a true utility that might even cancel out a Google search or a Yelp deep-dive. That’s a pretty bold thought, but when you think about how much data Foursquare has, a lot of things that we haven’t even seen yet are possible.

The filter options make all of this data more manageable and of course, usable, to get you to try out more places. It’s also an incentive for more businesses to adopt Foursquare’s offerings, such as specials. If people start filtering their searches in the way that Foursquare suggests, then it behooves these restaurants and bars to have multiple specials lined up and ready to go. Think of it as a highlighted ad in Google search.

Source: See Here

Keep Coding 🙂



iOS 7 Will Introduce Flickr, Vimeo Integration


Apple’s iOS 7 could introduce deep integration with Flickr and Vimeo, similar to how Twitter and Facebook are currently built into the company’s mobile ecosystem. According to9to5Mac, those partnership talks first mentioned back in April are turning up some exciting opportunities for the two companies; Flickr would be a huge one for both, especially since Yahoo just announced 1TB of free storage for every Flickr user.

Presumably, users will input their Flickr/Vimeo credentials into the settings menu and then have the option to upload photos and videos directly from the iOS Photos app. That simple integration is a no-brainer, and would quickly grow Flickr’s forgotten photo-sharing emporium. Apple’s iPhone is already the most popular method for shooting photos—adding Flickr integration would instantly spike the device’s presence up even more.



Vimeo integration would work in a similar fashion, giving users the option to upload immediately after a video is recorded. It’s no YouTube—you can always use YouTube Capture for that—but it introduces a separate option that would certainly increase the popularity of the oft-overlooked video-sharing platform. Both Flickr and Vimeo already offer integration in OS X, and this only seems like a natural extension.

Being able to instantly upload photos and videos to well-known services can provide more opportunities for users to share, and it’ll free up much needed space on an actual device. Not only that, but integration would likely boost the profile for each service, and especially give Flickr a big uptick in traffic. That 1TB of free storage certainly doesn’t hurt and is pretty darn enticing.

9to5Mac does note that the features, if not fully ready, could be removed prior to Apple’s WWDC in June. With rumors that Apple and Yahoo were in discussion to introduce deeper integration between the two companies, Flickr and Vimeo sound like prime candidates. Now if only Yahoo’s new weather app would get more deeply integrated into iOS 7.


An introduction to cross-platform mobile development technologies

An introduction to cross-platform mobile development technologies



Smartphones and tablets are becoming ubiquitous, and, with them, mobile apps. But what does the proliferation of different devices mean for developers entering the market? Do you target a single platform, build your app twice for iOS and Android, or use a cross-platform framework?

Here’s a bit of history, and an overview of the different technologies on the market now:


First, there was the iPhone

There were smartphones before the iPhone and there were mobile apps as well. Windows CE was first released in 1996, but it was Apple’s iPhone (launched in 2007) that really signaled the start of the smartphone era.

Originally, the iPhone didn’t allow third-party native-code apps to be installed; developers wanting to add their own content had to do so using HTML web apps running in the phone’s browser. There were some extensions to make such apps look like Apple’s apps rather than web pages, but access to the hardware was limited.

With 2008 came the App Store, and with it the opportunity to develop in native apps in Objective C. This wasn’t without limitations: development required a Mac, Xcode, and only documented parts of the API were available. The resulting app then had to be vetted before being published.

However, the iPhone’s dominance at this stage meant that mobile developers really only had to target one platform, one device, and a very small set of OS versions.

Then Android. Many, many Androids!

Founded in 2003, acquired by Google in 2005, and with the first handset launched in 2008, the Android platform has since seen an explosion of devices since the original G1. In fact, Wikipedia currently lists nearly 100 such devices, made by over 30 manufacturers.

Android devices now collectively account for over 50% of worldwide smartphone sales (Gartner, Q1 2012), but, unlike the iPhone, there’s huge variation in just about everything: screen size, resolution, processor speed, memory, features, and OS version.

Suddenly the idea of developing a single app that runs everywhere (or nearly everywhere) became a goal that was much harder to achieve – but one that remains as attractive as ever.

Solution #1: Cross-platform compilers

These come in a variety of guises. There’s the lowest level: C compilers, linking against the various platform SDKs. You’re working in a common language, but the APIs are vastly different.

Thankfully, there are options at a higher level, too: Appcelerator’s Titanium platform compiles JavaScript code into native apps, linking it against their platform-neutral SDK. Xamarin offer a C# compiler targeting both Android (MonoDroid) and iOS (MonoTouch).

These (and other similar) platforms offer a common language, but still one that needs to be compiled for multiple devices.

Solution #2: HTML 5 web apps

With HTML 5, code running in web browsers is able to provide an increasingly rich client-side experience: local storage, geolocation, audio and video, offline working, accelerated graphics operations and more. The distinction between apps and website has certainly become more blurred.

A great example here is Amazon’s Kindle web app on iOS: because of changes in App Store policies, they opted to go for a pure HTML5 app, whilst still allowing users to download content for later use, and keeping a great user experience.

One of the downsides here is more social than technical: many people now expect apps to be listed in app stores, and have become used to the discovery and installation process associated with their platform of choice. There are also still some limits on the APIs available, and the amount of data that can be stored locally.

Solution #3: HTML5 hybrid apps

A further solution is to develop your app using a combination of HTML5, JavaScript, and usually some extra libraries, and then wrapping it in a relatively thin native-code wrapper.

The advantage of this approach over the two covered above is that it combines the benefits of both HTML5 and native apps: there’s a common development language, a common set of APIs for all supported platforms, and enhanced access to the device over a pure HTML 5 web app. Local storage can exceed the 5MB limit, photos from the local device can be uploaded, background services can run (on some platforms), and so on.

Leading this field is the PhoneGap framework – now donated to the Apache Software Foundation as an open-source project and renamed Apache Cordova. Cordova provides a platform-specific wrapper for Android, iOS, BlackBerry and Windows Phone, and exposes a platform-independent API to code against in JavaScript.

Web development skills now apply equally to mobile apps – the same language, the same design process, and the same technologies.

The final sticking point, however, is the build process. To compile apps into their native wrappers, you still need the SDK for each platform. And that’s not as easy as it sounds: iOS requires a Mac, Windows Phone requires a Windows PC, and getting the Android SDK going isn’t generally the slickest experience.

Enter the hosted build services…

If the idea of hybrid app development appeals, but the setup cost and effort doesn’t, then hosted build services may be the right answer.

If Dreamweaver is your world, Adobe have integrated the PhoneGap Build service into their new Creative Cloudoffering. If you’re more development-oriented, Red Gate’s Nomad allows you to work in Microsoft Visual Studio, before shipping your code off to their cloud-based build service. Once built you get native iOS and Android apps, ready to use on your devices – no Mac required.

It’s worth noting that (whichever solution you use), to build apps for the iOS App Store, you’ll still need to be a member of the Apple iOS Developer Program, which is $99 a year.

So native development is dead?

Definitely not. There’s a class of apps that just can’t be built using hybrid or cross-platform technologies: from low-level utilities (such as the excellent Tasker app on Android), high-performance games (although the graphics performance available through Canvas is improving all the time), to those talking to parts of the platform SDK or peripherals that just aren’t available in your cross-platform framework of choice.

But for 90% of the apps out there, consider whether your time is really best spent setting up multiple development environments, re-developing your app in several different and unfamiliar languages, or whether you can use the work that a fantastic community of people have already done for you.

Reference From : see here


Keep Coding 🙂


iDev: Statistical Formulas For Programmers


Here the list of statistics formulas which is used in daily life:

  1. Formulas For Reporting Averages
    1. Corrected Standard Deviation
    2. Standard Error of the Mean
    3. Confidence Interval Around the Mean
    4. Two-Sample T-Test
  2. Formulas For Reporting Proportions
    1. Confidence Interval of a Bernoulli Parameter
    2. Multinomial Confidence Intervals
    3. Chi-Squared Test
  3. Formulas For Reporting Count Data
    1. Standard Deviation of a Poisson Distribution
    2. Confidence Interval Around the Poisson Parameter
    3. Conditional Test of Two Poisson Parameters
  4. Formulas For Comparing Distributions
    1. Comparing an Empirical Distribution to a Known Distribution
    2. Comparing Two Empirical Distributions
    3. Comparing Three or More Empirical Distributions
  5. Formulas For Drawing a Trend Line
    1. Slope of a Best-Fit Trend Line
    2. Standard Error of the Slope
    3. Confidence Interval Around the Slope

1. Formulas For Reporting Averages

One of the first programming lessons in any language is to compute an average. But rarely does anyone stop to ask: what does the average actually tell us about the underlying data?

1.1 Corrected Standard Deviation

The standard deviation is a single number that reflects how spread out the data actually is. It should be reported alongside the average (unless the user will be confused).



  • N is the number of observations
  • xi is the value of the ith observation
  • x¯ is the average value of xi

Reference: Standard deviation (Wikipedia)

1.2 Standard Error of the Mean

From a statistical point of view, the “average” is really just an estimate of an underlying population mean. That estimate has uncertainty that is summarized by the standard error.


Reference: Standard error (Wikipedia)

1.3 Confidence Interval Around the Mean

A confidence interval reflects the set of statistical hypotheses that won’t be rejected at a given significance level. So the confidence interval around the mean reflects all possible values of the mean that can’t be rejected by the data. It is a multiple of the standard error added to and subtracted from the mean.



  • α is the significance level, typically 5% (one minus the confidence level)
  • tα/2 is the 1−α/2 quantile of a t-distribution with N−1 degrees of freedom

Reference: Confidence interval (Wikipedia)

1.4 Two-Sample T-Test

A two-sample t-test can tell whether two groups of observations differ in their mean.

The test statistic is given by:


The hypothesis of equal means is rejected if |t| exceeds the (1−α/2) quantile of a t distribution with degrees of freedom equal to:


You can see a demonstration of these concepts in Evan’s Awesome Two-Sample T-Test.

Reference: Student’s t-test (Wikipedia)

2. Formulas For Reporting Proportions

It’s common to report the relative proportions of binary outcomes or categorical data, but in general these are meaningless without confidence intervals and tests of independence.

2.1 Confidence Interval of a Bernoulli Parameter

A Bernoulli parameter is the proportion underlying a binary-outcome event (for example, the percent of the time a coin comes up heads). The confidence interval is given by:



  • p is the observed proportion of interest
  • zα/2 is the (1−α/2) quantile of a normal distribution

This formula can also be used as a sorting criterion.

Reference: Binomial proportion confidence interval (Wikipedia)

2.2 Multinomial Confidence Intervals

If you have more than two categories, a multinomial confidence interval supplies upper and lower confidence limits on all of the category proportions at once. The formula is nearly identical to the preceding one.



  • pj is the observed proportion of the jth category

Reference: Confidence Intervals for Multinomial Proportions

2.3 Chi-Squared Test

Pearson’s chi-squared test can detect whether the distribution of row counts seem to differ across columns (or vice versa). It is useful when comparing two or more sets of category proportions.

The test statistic, called X2, is computed as:



  • n is the number of rows
  • m is the number of columns
  • Oi,j is the observed count in row i and column j
  • Ei,j is the expected count in row i and column j

The expected count is given by:


A statistical dependence exists if X2 is greater than the (1−α) quantile of a χ2 distribution with (m−1)×(n−1) degrees of freedom.

You can see a 2×2 demonstration of these concepts in Evan’s Awesome Chi-Squared Test.

Reference: Pearson’s chi-squared test (Wikipedia)

3. Formulas For Reporting Count Data

If the incoming events are independent, their counts are well-described by a Poisson distribution. A Poisson distribution takes a parameter λ, which is the distribution’s mean — that is, the average arrival rate of events per unit time.

3.1. Standard Deviation of a Poisson Distribution

The standard deviation of Poisson data usually doesn’t need to be explicitly calculated. Instead it can be inferred from the Poisson parameter:


This fact can be used to read an unlabeled sales chart, for example.

Reference: Poisson distribution (Wikipedia)

3.2. Confidence Interval Around the Poisson Parameter

The confidence interval around the Poisson parameter represents the set of arrival rates that can’t be rejected by the data. It can be inferred from a single data point of c events observed over t time periods with the following formula:



  • γ−1(p,c) is the inverse of the lower incomplete gamma function

Reference: Confidence Intervals for the Mean of a Poisson Distribution

3.3. Conditional Test of Two Poisson Parameters

Please never do this:

From a statistical point of view, 5 events is indistinguishable from 7 events. Before reporting in bright red text that one count is greater than another, it’s best to perform a test of the two Poisson means.

The p-value is given by:



  • Observation 1 consists of c1 events over t1 time periods
  • Observation 2 consists of c2 events over t2 time periods
  • c=c1+c2 and t=t1+t2

You can see a demonstration of these concepts in Evan’s Awesome Poisson Means Test.

Reference: A more powerful test for comparing two Poisson means (PDF)

4. Formulas For Comparing Distributions

If you want to test whether groups of observations come from the same (unknown) distribution, or if a single group of observations comes from a known distribution, you’ll need a Kolmogorov-Smirnov test. A K-S test will test the entire distribution for equality, not just the distribution mean.

4.1. Comparing An Empirical Distribution to a Known Distribution

The simplest version is a one-sample K-S test, which compares a sample of n points having an observed cumulative distribution function F to a known distribution function having a c.d.f. of G. The test statistic is:


In plain English, Dn is the absolute value of the largest difference in the two c.d.f.s for any value of x.

The critical value of Dn is given by Kα/n‾√, where Kα is the value of x that solves:


The critical must be solved iteratively, e.g. by Newton’s method. If only the p-value is needed, it can be computed directly by solving the above for α.

Reference: Kolmogorov-Smirnov Test (Wikipedia)

4.2. Comparing Two Empirical Distributions

The two-sample version is similar, except the test statistic is given by:


Where F1 and F2 are the empirical c.d.f.s of the two samples, having n1 and n2 observations, respectively. The critical value of the test statistic is Kα/n1n2/(n1+n2)‾‾‾‾‾‾‾‾‾‾‾‾‾‾√ with the same value of Kαabove.

Reference: Kolmogorov-Smirnov Test (Wikipedia)

4.3. Comparing Three or More Empirical Distributions

A k-sample extension of Kolmogorov-Smirnov was described by J. Kiefer in a 1959 paper. The test statistic is:


Where F¯ is the c.d.f. of the combined samples. The critical value of T is a2 where a solves:



  • h=k−1
  • Jh/2 is a Bessel function of the first kind with order h/2
  • γ(h−2)/2,n is the nth zero of J(h−2)/2

To compute the critical value, this equation must also be solved iteratively. When k=2, the equation reduces to a two-sample Kolmogorov-Smirnov test. The case of k=4 can also be reduced to a simpler form, but for other values of k, the equation cannot be reduced.

Reference: K-sample analogues of the Kolmogorov-Smirnov and Cramer-v. Mises tests (JSTOR)

5. Formulas For Drawing a Trend Line

Trend lines (or best-fit lines) can be used to establish a relationship between two variables and predict future values.

5.1. Slope of a Best-Fit Line

The slope of a best-fit (least squares) line is:



  • {x1,…,xN} is the independent variable with sample mean x¯
  • {y1,…,yN} is the dependent variable with sample mean y¯

5.2. Standard Error of the Slope

The standard error around the estimated slope is:


5.3. Confidence Interval Around the Slope

The confidence interval is constructed as:



  • α is the significance level, typically 5% (one minus the confidence level)
  • tα/2 is the 1−α/2 quantile of a t-distribution with N−2 degrees of freedom

Reference: Simple linear regression (Wikipedia)

Reference Site : See Here

Keep Coding 🙂

Thanks 🙂

The CORRECT Way to Code a Custom Exception Class

There is a lot of advice out there on how to go about building your own custom exception classes.  A lot of these sources are at least partially correct. Some are totally wrong.  Some even advocate abandoning the base System.Exception class altogether, but that’s throwing the baby out with the bathwater, in my opinion.  None that I’ve seen show how to serialize/deserialize your custom exception class should it have additional data in it’s subclass. It’s enough to make one despair of ever finding the “right” way to build an exception class. 

A lot of the confusion around exceptions comes about if you’ve ever actually tried to serialize an exception using an Xml-based serializer.  You are testing the code you write, correct? When attempting to serialize your nice new exception class with something like XmlSerializer, the serializer will simply choke, stating that it can’t serialize any class that has an IDictionary member.  And System.Exception has an IDictionary in it.  Yet every piece of literature coming out of Microsoft says that we should build custom exceptions (sub-typed from Exception, and not ApplicationException) and mark them as [Serializable].  What gives?  Well, there are more serializers in the world than just the XML-based serializers, and that’s when it’s important to serialize exceptions.  The System.Runtime.Serialization.Formatters.Binary.BinaryFormatter, for example, serializes exceptions just fine.

So, how do you derive from Exception correctly, particularly if you’ve got additional information in your custom exception class?  I thought you’d never ask.

    public class AuthorizationRequiredException : Exception
        public string ResourceReferenceProperty { getset; }
        public AuthorizationRequiredException()
        public AuthorizationRequiredException(string message)
            : base(message)
        public AuthorizationRequiredException(string message, Exception inner)
            : base(message, inner)
        protected AuthorizationRequiredException(SerializationInfo info, StreamingContext context)
            : base(info, context)
            ResourceReferenceProperty = info.GetString("ResourceReferenceProperty");
        [SecurityPermission(SecurityAction.DemandSerializationFormatter = true)]
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
            if (info == null)
                throw new ArgumentNullException("info");
            base.GetObjectData(info, context);
  And here are the tests that drive it to completion (updated to show better testing methods):
    public class AuthorizationRequiredExceptionTests
        public void AuthorizationRequiredException_default_ctor()
            // Arrange
            const string expectedMessage = "Exception of type 'MyApp.Exceptions.AuthorizationRequiredException' was thrown.";
            // Act
            var sut = new AuthorizationRequiredException();
            // Assert
            Assert.AreEqual(expectedMessage, sut.Message);
        public void AuthorizationRequiredException_ctor_string()
            // Arrange
            const string expectedMessage = "message";
            // Act
            var sut = new AuthorizationRequiredException(expectedMessage);
            // Assert
            Assert.AreEqual(expectedMessage, sut.Message);
        public void AuthorizationRequiredException_ctor_string_ex()
            // Arrange
            const string expectedMessage = "message";
            var innerEx = new Exception("foo");
            // Act
            var sut = new AuthorizationRequiredException(expectedMessage, innerEx);
            // Assert
            Assert.AreEqual(innerEx, sut.InnerException);
            Assert.AreEqual(expectedMessage, sut.Message);
        public void AuthorizationRequiredException_serialization_deserialization_test()
            // Arrange
            var innerEx = new Exception("foo");
            var originalException = new AuthorizationRequiredException("message", innerEx) { ResourceReferenceProperty = "MyReferenceProperty" };
            var buffer = new byte[4096];
            var ms = new MemoryStream(buffer);
            var ms2 = new MemoryStream(buffer);
            var formatter = new BinaryFormatter();
            // Act
            formatter.Serialize(ms, originalException);
            var deserializedException = (AuthorizationRequiredException)formatter.Deserialize(ms2);
            // Assert
            Assert.AreEqual(originalException.ResourceReferenceProperty, deserializedException.ResourceReferenceProperty);
            Assert.AreEqual(originalException.InnerException.Message, deserializedException.InnerException.Message);
            Assert.AreEqual(originalException.Message, deserializedException.Message);
        public void AuthorizationRequiredException_GetObjectData_throws_exception_when_info_null()
            // Arrange
            var sut = new AuthorizationRequiredException("message") { ResourceReferenceProperty = "MyReferenceProperty" };
            // Act
            // ReSharper disable AssignNullToNotNullAttribute
            sut.GetObjectData(nullnew StreamingContext());
            // ReSharper restore AssignNullToNotNullAttribute
            // Assert
            // [ExpectedException(typeof(ArgumentNullException))]

If you use this code as a template for creating your custom exceptions, you won’t go too far wrong, I think.

As far as XML-based serializers goes, I hope that the Base Class Library team will take some time and just fix the “chokes on IDictionary” issue.  Frankly, it’s quite embarrassing.


Reference Site : See Here


Keep Coding:)

Thanks 🙂

iDev: Enable or Disable ARC

iDev: Enable or Disable ARC

Enable ARC on OLD files : 

I want to bring a single Objective-C class written using ARC into an old project.

Add -fobjc-arc flag to any files for which you’d like to enable ARC, as described in the ARC documentation

If you want to enable ARC for many files, you have to:

  1. Open “Build phases” –> “Compile sources”
  2. Select files with “left_mouse” + “cmd” (for separated files) or “shift” (for grouped files – select first and last)
  3. Press “enter”
  4. Paste -fobjc-arc
  5. Press “Enter/Done”.

Disable ARC on MULTIPLE files:

Add -fno-objc-arc flag to any files for which you’d like to disable ARC, as described in the ARC documentation

If you want to disable ARC for many files, you have to:

  1. Open “Build phases” –> “Compile sources”
  2. Select files with “left_mouse” + “cmd” (for separated files) or “shift” (for grouped files – select first and last)
  3. Press “enter”
  4. Paste -fno-objc-arc
  5. Press “Enter/Done”.

Keep Coding 🙂


iDev: Test Flight: Beta Deployments for iOS Apps

Hello Friends : 

A new post for you…….

One of the more challenging things in creating iOS applications is the whole provisioning and deployment process.  This becomes especially true during beta testing of your application using Ad-Hoc distribution.

The process is something like this:

  1. Gather all the UDIDs from your test subjects
  2. Enter these into the iOS Provisioning Portal
  3. Create a distribution certificate (if you haven’t already)
  4. Create an Ad-Hoc provisioning profile
  5. Download the profile and certificate
  6. Configure and build your app signing with these credentials

Then, your testers need to get the application and install it.  Generally like this:

  1. Email the testers the provisioning profile and app bundle
  2. The tester need to drag both to iTunes (or Organizer) and then tether and sync

This makes it a little cumbersome for most testers and difficult for non-tech savvy users.  One could post the app bundle to a website with a manifest and then create a launch page (like an internal app store) and then notify the users.  This is where Test Flight ( comes in … managing the web-delivery of your application in a really easy-to-use process.

Remembering the above, now I do this:

  1. (optional) Ask your test users to register their devices
  2. (optional) Create a team out of these testers and download their device IDs
  3. (optional) Upload all of these device IDs at one time to the Provisioning Portal
  4. Follow the same process as above to create a provisioning profile and build
  5. Now upload the IPA bundle to Test Flight and I am done

At this point, the testers can receive a notification of the new build (and subsequent builds) and simply visit Test Flight on their device.  They will be able to install your beta app straight from the browser.  Further, I can report on who has installed the app and who has not.

All this and the website has a nice easy to use design on top of that!

Thanks ;

Keep Coding 🙂